If some of the values are available only in run time then the answer is no - you will have to set up a proper data transfer. But if all of the values are available during the CLJS compile time, then you can use macros.
cljs.user> (goog/typeOf #(:a %))
"function"
cljs.user> (goog/typeOf :a)
"object"
Are there any libraries or ideas for only performing effects (like backend calls) for Reagent components that are actually visible on the user’s screen? Maybe by utilizing `js/IntersectionObserver`? Maybe by not even loading the component using a library?
If I hold a symbol in cljs that maps to a namespaced var, is there a way to perform a lookup of the var at runtime?
Is there a way to compute requires using macro’s or reader macro’s at compile time? Or something similar?
CLJS doesn't have vars at runtime but you can get whatever would be in the var via (js/goog.getObjectByName "cljs.core.assoc")
or so
Does that work with optimizations? @thheller
Like https://github.com/tape-framework/mvc/blob/master/src/tape/mvc.clj#L239?
Awesome thanks!
yes! I think so!
no it does not
Yeah, I tried this sort of stuff for https://github.com/tape-framework and settled with registering things and latter retrieval from the registry.
because optimizations erase the names
Are there any libraries or ideas for only performing effects (like backend calls) for components that are actually visible on the user’s screen? Maybe by utilizing `js/IntersectionObserver`? Maybe by not even loading the component using a library?
Oh oops I thought my connection was lost
And the question was not posted
but no solutions I see
nor on the internet specific to re-frame. then we roll our own 🙂
When in doubt, try ctrl+shift+r
(at least on Windows and Linux - MacOS may have some other shortcut) - it will refresh the desktop Slack app.
Ah I see
thanks
Please try to avoid posting the same question in multiple channels, let alone multiple times in the same channel.
cool. Thanks for the pointers
Thanks