Is there a way to trigger a callback after a rerender? or just requestAnimationFrame
?
@urbank : on every re-render or just some? your view function runs on every render, so you could just put logic right in there, or call another function, which will run on every re-render
@ajs Oh, yeah, I wasn't specific enough. I meant after an om/transact!
after a specific om/transact!
what i do myself is send all transact or update messages on a go channel. then when i listen to that channel, if a particular key that was sent along with the transact or update messages is of interest, i do something specific when i receive that transact for that key
incidentally the reason i do this in Om Now is so that any component function can transact on any part of Om state, even if it is not related to the cursor that component received
@ajs Ah, I see. Interesting. Haven't seen go block used much in the om next examples within the ui
yeah om next is different
but you can still write Om Now code using Om Next
the dom and core namespaces are the same
i'm actually a big fan of Om Now
@ajs You prefer it to om next?
definitely for me, for now
Om Next is really a very different animal
Om Now is stable and pretty simple. Om Next is neither of those things (yet)
Hey guys, I'm sure this is a Clojure mistake but I'm having a tough time figuring out what my issue is with updating my state. Does anything jump out? When I call this, state doesn't change.
(om/update-state! this
update-in
[:props :project/nodes]
(fn [nodes]
(vec (map #(merge % {:node/selected true})
nodes))))
@urbank you can use :tx-listen
to get a feed of transactions. We've been considering using it for things like reporting google analytics.
@dehli which state are you trying to update, the app state or the component local state?
component local state
I find that it's quite simple using #fulcro
That sounds fairly straightforward. I'll check it out.
okay, so this is the problem from coding late at night 🙂 I'm overriding state in componentWillReceiveProps
ah
Thanks for the help!
Hi all, I’m trying to use om/force
, and the documentation says to look for a :target
key in the ast, but it doesn’t seem to exist in ast. I have, however, found :target
in env
. Has the target been moved to env, or is this a different thing altogether?