Skip to content

Instantly share code, notes, and snippets.

@jwhitlark
Created June 20, 2014 20:28
Show Gist options
  • Save jwhitlark/9b99e6448067e35f79b9 to your computer and use it in GitHub Desktop.
Save jwhitlark/9b99e6448067e35f79b9 to your computer and use it in GitHub Desktop.
Two utility fn's
(defn listen [el & types]
(let [out (chan)]
(doall (map (fn [type] (events/listen el type #(put! out %))) types))
out))
(defn set-states! [owner desired]
(doall (map #(om/set-state! owner (key %) (val %)) desired)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment