Last active
December 31, 2015 23:28
-
-
Save ddeaguiar/8059877 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn listen [el type] | |
(let [out (chan)] | |
(events/listen el type | |
(fn [e] (put! out e))) | |
out)) | |
... | |
... | |
(defn init [] | |
(let [clicks (listen (dom/getElement "search") "click") | |
results-view (dom/getElement "results")] | |
(go (while true | |
(<! clicks) | |
(let [[_ results] (<! (jsonp (query-url (user-query))))] | |
(set! (.-innerHTML results-view) (render-query results))))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment