setStore function replace object value
https://playground.solidjs.com/anonymous/f0b1602b-24a8-48db-a37d-e60db6eb3f85
In this example setStore is replacing whole store, instead it should merge the store.
Solid Playground
Quickly discover what the solid compiler will generate from your JSX template
7 Replies
I think this is expected behavior. I think solid only merges the top level of the object you pass to set store, it doesn't merge recursively
setStore("a", "b", {e: 4})
will merge, I thinkwhy it remove the
e
key from top level store?Oh, I see, it seems to be removing the "e" key from the top level 🤔. I don't think that's meant to be the behavior?
e isn't top level though?
it's part of a
the merging behaviour is shallow
Ah you're right. All the nesting confused me (and I was falling asleep 🙂)
Is it a bug?
No
As explained here