From 58562a34ade068a99d311e4f545d25c502dceff8 Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote Date: Sun, 11 Jul 2021 20:40:30 +0200 Subject: [PATCH] fix: avoid watchers to trigger while building the store --- src/store.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 } -- 2.47.2