specter

Latest version: 1.1.3
jimi 2020-02-23T11:10:57.000600Z

Can someone help me translates this function into a specter one?

(defn get-component!
  [system component-key]
  (or (get system component-key)
      (->> system
           (filter (fn [[current-key]]
                     (and (vector? current-key)
                          (= 2 (count current-key))
                          (= component-key (second current-key)))))
           (map val)
           (first))
      (throw (ex-info "missing component" {:tag ::get-component!
                                           :component component-key}))))