From: Eduardo San Martin Morote Date: Thu, 15 Apr 2021 14:46:22 +0000 (+0200) Subject: refactor: use assign X-Git-Tag: v2.0.0-alpha.14~52 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=af53a60c5ca348cb2f213163391285bbecbcddbe;p=thirdparty%2Fvuejs%2Fpinia.git refactor: use assign --- 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