I feel like I asked this before, when I want to pass js object props to a component when using $, how do I do that? Is {:& (theProps)}
my only option? It feels inefficient.
yeah, {:& whatever-props}
Oh, you actually optimize this case. By checking for (seq m) and just returning it if so, nice.
ah, but native props is runtime :thinking_face:
Oh, everything goes through it, so all good
I wish I had a recursive #js sometimes, I wrote one once.
Yeah same
Really I wish that maps compiled to #js if they’re never assoced 😝
I can't even imagine the analysis on that...
My colleague has expressed similar wishes though, except that everything was #js by default… I didn't like that as much because mutability.
I did just discover that the appliedscience js-interop library has j/lit for this use-case, but I'm trying to reduce my dependence on that. I think cljs-bean & goog.object are better/good enough, respectively.
or even if JS objects implemented assoc / get / etc. and just did copy-on-write
i’m not sure how safe that would be tho since there’s a lot of objects out there that you might not want those semantics 😛
the conflation of data literal === object is annoying in this case
does anyone here has an experience with reitit
? is it worth the try?
@lilactown also, the new proxies feature would be a real thorn in that. Imagine doing a get on an object and it starts doing stuff.
well that’s already possible in CLJS 😛 since get
is just a protocol, anyone can do anything in it!
There is examples of doing that, though dnolen has discouraged for reasons I forget
would be fun to play with a mobx-like reactive interface where get
is what attaches listeners and assoc
triggers downstream changes
stahp
lol