mirror of
https://github.com/pmndrs/zustand.git
synced 2025-12-08 19:45:52 +00:00
Fix document details (#1752)
export const useBoundStore = create((set) => ({
count: 0,
text: 'hello',
inc: () => set((state) => ({ count: state.count + 1 })),
setText: (text) => set({ text }),
})
example on this page is missing a trailing parenthesis
This commit is contained in:
parent
7cdb5f5bb2
commit
df38aa8c5a
@ -13,7 +13,7 @@ export const useBoundStore = create((set) => ({
|
|||||||
text: 'hello',
|
text: 'hello',
|
||||||
inc: () => set((state) => ({ count: state.count + 1 })),
|
inc: () => set((state) => ({ count: state.count + 1 })),
|
||||||
setText: (text) => set({ text }),
|
setText: (text) => set({ text }),
|
||||||
})
|
}))
|
||||||
```
|
```
|
||||||
|
|
||||||
This creates a self-contained store with data and actions together.
|
This creates a self-contained store with data and actions together.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user