Skip to content

Commit 1f10d22

Browse files
committed
update
1 parent 1ba58f3 commit 1f10d22

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

src/routes/reference/store-utilities/create-store.mdx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff 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.
7272
import { createStore } from "solid-js/store";
7373

7474
const [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

0 commit comments

Comments
 (0)