clojurescript

ClojureScript, a dialect of Clojure that compiles to JavaScript http://clojurescript.org | Currently at 1.10.879
p-himik 2021-01-04T02:32:55.066900Z

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.

valtteri 2021-01-04T07:49:07.067200Z

cljs.user> (goog/typeOf #(:a %))
"function"
cljs.user> (goog/typeOf :a)
"object"

đź‘Ť 1
erwinrooijakkers 2021-01-04T15:06:28.071700Z

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?

Alexis Vincent 2021-01-04T15:21:31.072800Z

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?

Alexis Vincent 2021-01-04T15:27:09.073900Z

Is there a way to compute requires using macro’s or reader macro’s at compile time? Or something similar?

thheller 2021-01-04T17:11:19.074Z

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

clyfe 2021-01-04T17:25:13.074200Z

Does that work with optimizations? @thheller

Alexis Vincent 2021-01-04T17:26:21.074700Z

Awesome thanks!

Alexis Vincent 2021-01-04T17:29:06.075Z

yes! I think so!

thheller 2021-01-04T17:43:35.075200Z

no it does not

clyfe 2021-01-04T18:12:14.075400Z

Yeah, I tried this sort of stuff for https://github.com/tape-framework and settled with registering things and latter retrieval from the registry.

clyfe 2021-01-04T18:12:34.075900Z

because optimizations erase the names

erwinrooijakkers 2021-01-04T18:53:20.076700Z

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?

erwinrooijakkers 2021-01-05T12:24:11.085Z

Oh oops I thought my connection was lost

erwinrooijakkers 2021-01-05T12:24:28.085200Z

And the question was not posted

erwinrooijakkers 2021-01-05T12:24:57.085400Z

but no solutions I see

erwinrooijakkers 2021-01-05T12:25:03.085600Z

nor on the internet specific to re-frame. then we roll our own 🙂

p-himik 2021-01-05T12:25:17.085800Z

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.

erwinrooijakkers 2021-01-05T12:25:31.086100Z

Ah I see

erwinrooijakkers 2021-01-05T12:25:44.086300Z

thanks

đź‘Ť 2
p-himik 2021-01-04T18:58:11.076900Z

Please try to avoid posting the same question in multiple channels, let alone multiple times in the same channel.

Alexis Vincent 2021-01-04T22:24:53.077500Z

cool. Thanks for the pointers

Alexis Vincent 2021-01-04T22:25:02.077700Z

Thanks

đź‘Ť 1