This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-07-09
Channels
Hey y'all! A bit of a noob design/architecture(?) question on state management. I have a cljs project using UIx2 and Re-frame (Re-fx technically). I'm wondering if anyone has any guidance on when I should use the use-state hook vs "graduate" that state to re-frame? Thanks!
If you consider some state a part of the whole app's state, then put it inside re-frame's app-db. It's app-db after all. ;)
Is there a way to interactively see the JS that would be generated for a snippet of CLJS - like http://app.klipse.tech/ but within my REPL?
There’s a dynamic variable that prints out function bodies. Try (apropos “bodies”) and it should be in the list
thanks @U11BV7MTK!
yes, I (set! *print-fn-bodies* true)
and then when evaluating the function symbol I also see the body - that's quite useful
You can also do (println (str your-fn))
if you only need to print one, useful if you want to check what a lib or core fn does without re-evaluating it