From af53a60c5ca348cb2f213163391285bbecbcddbe Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote Date: Thu, 15 Apr 2021 16:46:22 +0200 Subject: [PATCH] refactor: use assign --- src/store.ts | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/store.ts b/src/store.ts index 329f4672..812c280a 100644 --- a/src/store.ts +++ b/src/store.ts @@ -230,13 +230,16 @@ function buildStoreToUse< } as StoreWithActions[typeof actionName] } - const store: Store = reactive({ - ...partialStore, - // using this means no new properties can be added as state - ...computedFromState(pinia.state, $id), - ...computedGetters, - ...wrappedActions, - }) as Store + const store: Store = reactive( + assign( + {}, + partialStore, + // using this means no new properties can be added as state + computedFromState(pinia.state, $id), + computedGetters, + wrappedActions + ) + ) as Store // use this instead of a computed with setter to be able to create it anywhere // without linking the computed lifespan to wherever the store is first -- 2.47.2