Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose cursor path #33

Closed
mullr opened this issue Dec 31, 2013 · 1 comment
Closed

Expose cursor path #33

mullr opened this issue Dec 31, 2013 · 1 comment

Comments

@mullr
Copy link

mullr commented Dec 31, 2013

This is useful when doing a custom state succession mechanism, instead of om.core/update! on deep cursors.

For example:

(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
    ; ... 
    ))
@swannodette
Copy link
Member

fixed in master 6ff8f57

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants