You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
260
260
261
261
```ts{4}
262
-
cartStore.$subscribe((state) => {
262
+
cartStore.$subscribe((mutation, state) => {
263
263
// persist the whole state to the local storage whenever it changes
0 commit comments