I'm just experimenting with Om, learning from the basic tutorial.
My program data is in a single atom : app-state.
If I put a sequence into that atom, eg.
(defonce app-state (atom {:things [1 2 3 4]}))
Then later on, in my rendering, I can get a cursor
(let [things (:things data)] ... )
and map across it :
(map #(* % %) things)
However, if I have a defrecord with a method that can return a sequence :
(defrecord ThingCollection [xs]
IThingCollection
(getSeq [this] ... ) )
and put THAT into the application state
(defonce app-state (atom {:things (->ThingCollection [1 2 3 4]})))
...
(let [things (:things data)] ... )
I can't do this :
(map #(* % %) (.getSeq things))
It just throws an error saying that a cursor has no method .getSeq
That makes sense. But then how can I actually get at the ThingCollection object inside the cursor? I can't find any examples of this. And nothing I've tried seems to give it to me.