From: Eduardo San Martin Morote Date: Sun, 11 Jul 2021 18:40:30 +0000 (+0200) Subject: fix: avoid watchers to trigger while building the store X-Git-Tag: v2.0.0-rc.0~79 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=58562a34ade068a99d311e4f545d25c502dceff8;p=thirdparty%2Fvuejs%2Fpinia.git fix: avoid watchers to trigger while building the store --- diff --git a/src/store.ts b/src/store.ts index 4ff234c4..fea344bc 100644 --- a/src/store.ts +++ b/src/store.ts @@ -156,7 +156,7 @@ function createSetupStore< } // internal state - let isListening = true + let isListening = false // set to true at the end let subscriptions: SubscriptionCallback[] = markRaw([]) let actionSubscriptions: StoreOnActionListener[] = markRaw([]) let debuggerEvents: DebuggerEvent[] | DebuggerEvent @@ -419,6 +419,7 @@ function createSetupStore< ;(options.hydrate || innerPatch)(store, initialState) } + isListening = true return store }