]> git.ipfire.org Git - thirdparty/vuejs/pinia.git/commitdiff
refactor: use assign
authorEduardo San Martin Morote <posva13@gmail.com>
Thu, 15 Apr 2021 14:46:22 +0000 (16:46 +0200)
committerEduardo San Martin Morote <posva13@gmail.com>
Thu, 15 Apr 2021 14:46:22 +0000 (16:46 +0200)
src/store.ts

index 329f4672df24f82bf92583ebd642b16f787403a0..812c280a388111299cd9db1b41195f711dd9af6e 100644 (file)
@@ -230,13 +230,16 @@ function buildStoreToUse<
     } as StoreWithActions<A>[typeof actionName]
   }
 
-  const store: Store<Id, S, G, A> = reactive({
-    ...partialStore,
-    // using this means no new properties can be added as state
-    ...computedFromState(pinia.state, $id),
-    ...computedGetters,
-    ...wrappedActions,
-  }) as Store<Id, S, G, A>
+  const store: Store<Id, S, G, A> = reactive(
+    assign(
+      {},
+      partialStore,
+      // using this means no new properties can be added as state
+      computedFromState(pinia.state, $id),
+      computedGetters,
+      wrappedActions
+    )
+  ) as Store<Id, S, G, A>
 
   // 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