Hey quick question, is there any destructing option on squint for js object props?
I think not, just found this issue https://github.com/squint-cljs/squint/issues/491
can you give an example of what you mean by this
I was searching for something like we can have with this lib on cljs https://github.com/applied-science/js-interop?tab=readme-ov-file#destructuring
can you give a specific code example
destructuring works in general
yeah, I never dared to just try this with js/objects haha
(let [{{href :href} :location} js/document]
href)
this just works, coolso you didn't dare to try it before asking? ;)
Yeah, sorry I just took for granted because the xp in cljs
took what for granted?
that object destructuring didn't work? squint is designed around JS objects so it better work
I took for granted that wouldn't work, for some reason, I always thought that destructuring would only work for clojure maps
squint doesn't have clojure maps
it's all JS objects
make sense
hope that didn't scare you ;)
Maybe I'm just still to attached with the old cljs, because this doesn't work there right?
(let [{{href :href} :location} js/document]
href)
I always used js-interop to be able to do something similar, but never stopped to think that squint is so thin that doesn't have any diff a map than a js/objectthat is the major difference between squint and #cherry: squint doesn't have immutable persistent data structures, it just works with the JS objects / arrays directly
I was just playing with preact, and it's really tiny compared to react, I'm using jotai for state management and the whole bundle is just 29kb https://github.com/yogthos/squint-preact-example