hey all - is there a predicate to check if an atom is a ratom??
beyond checking the type with instance?
one more Q… if I am reading a reagent state inside of an animation loop, where i DON’T want a re-render triggered in the component holding the loop, is this the preferred way to do a “sneaky read” of a ratom? https://clojurians.slack.com/archives/C0620C0C8/p1669207172826729?thread_ts=1669206982.672919&cid=C0620C0C8
you can use (.-state my-ratom)
deref returns that (after submitting the side effects to watchers) https://github.com/reagent-project/reagent/blob/e67d4f8804c109868469d6e81ecd7184cf707575/src/reagent/ratom.cljs#L137
nice!!! looks like if I do that it will work on cljs atoms as well. Thanks @danvingo
and I see the answer to my other question too: (satisfies? IReactiveAtom src)
sure thing 🙂
(also not sure what the performance cost is to running that binding call in a hot loop, maybe not much? reading the atom at all is obviously a cost, probably not much delta over that)
Hi everyone \o How can I do this in Reagent? I've tried the adapt-react-class functions and the [:> MyComponent ...] in parameters... but both has failed...
Okay, I've just figured out. The create-element did the trick \o