Replies: 3 comments
-
batch(() => {
setStore('toBeOverwritten', undefined);
setStore('toBeOverwritten', { newStuff: true });
}); |
Beta Was this translation helpful? Give feedback.
0 replies
-
ah. yep that'll do it, so simple I didn't think of it. thanks |
Beta Was this translation helpful? Give feedback.
0 replies
-
Just go up a level. It only merges shallow. // instead of
setStore("key", newObject)
// do this
setStore({
key: newObject
}) That being said we can't replace top level as we have an object proxy which needs a stable reference. We'd need to diff all the properties. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I ran into a use case where I want to be able to replace the value of a store and realized it isn't possible with the current api since using objects always merge, is there a recommended way to replace that?
https://playground.solidjs.com/anonymous/e4d159cc-294c-45f8-b1da-01a5ef93f78f
Beta Was this translation helpful? Give feedback.
All reactions