Skip to content

Commit 7895f89

Browse files
CyberAPStanislav Lashmanov
andauthored
docs: fix subscription arguments in docs (#2965)
Co-authored-by: Stanislav Lashmanov <[email protected]>
1 parent dcc34d2 commit 7895f89

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/docs/core-concepts/state.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ cartStore.$subscribe((mutation, state) => {
259259
Under the hood, `$subscribe()` uses Vue's `watch()` function. You can pass the same options as you would with `watch()`. This is useful when you want to immediately trigger subscriptions after **each** state change:
260260

261261
```ts{4}
262-
cartStore.$subscribe((state) => {
262+
cartStore.$subscribe((mutation, state) => {
263263
// persist the whole state to the local storage whenever it changes
264264
localStorage.setItem('cart', JSON.stringify(state))
265265
}, { flush: 'sync' })

0 commit comments

Comments
 (0)