reagent 2022-12-15

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)

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