We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 10cefab commit a175f3fCopy full SHA for a175f3f
1 file changed
README.md
@@ -59,7 +59,9 @@ const store = createStore({ players: 0 })
59
60
function subscribeToServerStore(listener) {
61
// Incrementing number of player as a patch
62
- const listeners = store.applyPatch({ players: store.state.players + 1 })
+ const listeners = store.applyPatch((state) => {
63
+ state.players += 1
64
+ })
65
// We emit the patch to all the subscribers
66
listeners.forEach(({ listener, patch }) => listener(patch))
67
// Here we subscribe our client
0 commit comments