File tree Expand file tree Collapse file tree
src/routes/reference/store-utilities Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -60,8 +60,8 @@ Tuple containing the store proxy and its setter.
6060## Behavior
6161
6262- The returned store is read through a proxy.
63- - The setter can update the whole store or specific paths.
64- - Object updates are shallowly merged by the setter .
63+ - The setter can replace the whole store or update nested paths.
64+ - Object updates shallow-merge by default, and setting a property to ` undefined ` deletes it .
6565- Getters defined on the initial object remain available on the store.
6666
6767## Examples
@@ -72,9 +72,13 @@ Tuple containing the store proxy and its setter.
7272import { createStore } from " solid-js/store" ;
7373
7474const [state, setState] = createStore ({
75- firstName: " John" ,
76- lastName: " Smith" ,
75+ user: {
76+ firstName: " John" ,
77+ lastName: " Smith" ,
78+ },
7779});
80+
81+ setStore (" user" , " firstName" , " Jane" );
7882```
7983
8084### Getter
You can’t perform that action at this time.
0 commit comments