mirror of
https://github.com/pmndrs/zustand.git
synced 2025-12-08 19:45:52 +00:00
parent
f73736d59a
commit
642b0bc055
@ -149,12 +149,12 @@ const useFishStore = create((set) => ({
|
||||
|
||||
```jsx
|
||||
const useSoundStore = create((set, get) => ({
|
||||
sound: "grunt",
|
||||
sound: 'grunt',
|
||||
action: () => {
|
||||
const sound = get().sound
|
||||
// ...
|
||||
}
|
||||
})
|
||||
},
|
||||
}))
|
||||
```
|
||||
|
||||
## Reading/writing state and reacting to changes outside of components
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user