Fork me on GitHub
#helix
<
2022-05-17
>
geraldodev22:05:01

I'm trying to port modulz design-system to cljs, and I'm using j/lit to brew js objects. I had an issue with a button that I suspect that has to do with order. Digging into I saw that the source object had all: 'unset'. I suspect that when I the object is tranformed into js the unpredictable order of clojure hash map is hitting me. So I ask: Does javascript respect the order of the keys in the Object ? It appears to do so. Object.keys shows the keys in the order of definition.

geraldodev10:05:29

Now I'm using (jsvec-to-obj (j/lit ["all" "unset" ... and jsvec-to-obj instantiates a js object pairing the vec keys, I pay a hit at runtime, but the order is preserved and js can can apply its rules without being messed by the rules of the clojure map (j/lit {"all" "unset" ...