Created
December 31, 2013 02:27
-
-
Save mullr/8191555 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
;;; Event loop | |
(def ^:dynamic *ui-events-chan* (chan)) | |
(defn post-event [type cursor param] | |
(let [path (.-path cursor)] | |
(put! *ui-events-chan* [type path param]))) | |
(declare handle-event) | |
(defn run-event-loop [root-cursor] | |
(go-loop [] | |
(om/update! root-cursor handle-event (<! *ui-events-chan*)) | |
(recur))) | |
(defn handle-event [app [type path param :as e]] | |
(case type | |
; ... | |
)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment