]> git.ipfire.org Git - thirdparty/vuejs/pinia.git/commitdiff
docs: fix subscription arguments in docs (#2965)
authorStanislav Lashmanov <stasvarenkin@gmail.com>
Tue, 1 Jul 2025 09:58:36 +0000 (13:58 +0400)
committerGitHub <noreply@github.com>
Tue, 1 Jul 2025 09:58:36 +0000 (11:58 +0200)
Co-authored-by: Stanislav Lashmanov <slashmanov@gitlab.com>
packages/docs/core-concepts/state.md

index 64bbae7a769662567df1ed06a39d2a2bff0f773c..a0bacc5a3d6b64d23d91386a8d1a929c3ce54aad 100644 (file)
@@ -259,7 +259,7 @@ cartStore.$subscribe((mutation, state) => {
 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:
 
 ```ts{4}
-cartStore.$subscribe((state) => {
+cartStore.$subscribe((mutation, state) => {
   // persist the whole state to the local storage whenever it changes
   localStorage.setItem('cart', JSON.stringify(state))
 }, { flush: 'sync' })