Hey there,

with my humble ClojureScript skills, I'm attempting to use Om and DataScript 
together. But I struggle with closing the gap between a DataScript query and an 
Om cursor. 

In my test app I have a DataScript query 'q-count' and an Om component 
'app-counter'. The main component looks like this:

  (defn app-view []
    (reify
      om/IRender
      (render [_]
        (let [count (query q-count)]
          (dom/div nil
            (dom/h2 nil "Hello World")
            (om/build #(app-counter count) {}))))))

The 'query' function is supposed to run the query and, in order for the Om 
component to automatically refresh upon change, return a cursor (it only needs 
to be readable, not writeable).

But how do I create a cursor from the query? I suppose Dave Dixon's Reagent 
example can be applied here but I simply can't connect the dots.

PS: The complete source code of the test app can be found at 
https://github.com/stephanos/om-tutorial/blob/counter/src/todomvc/app.cljs

Stephan

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/clojurescript.

Reply via email to