]> git.ipfire.org Git - thirdparty/vuejs/pinia.git/commitdiff
refactor: types
authorEduardo San Martin Morote <posva13@gmail.com>
Wed, 17 May 2023 08:15:33 +0000 (10:15 +0200)
committerEduardo San Martin Morote <posva@users.noreply.github.com>
Wed, 17 May 2023 08:26:48 +0000 (10:26 +0200)
packages/pinia/src/store.ts

index 50b15444c089cd042e363d4549037e2fa44ecadd..3faa689aa8bafbb0b21233055aa2d09ad59c6ced 100644 (file)
@@ -52,7 +52,7 @@ import { IS_CLIENT, USE_DEVTOOLS } from './env'
 import { patchObject } from './hmr'
 import { addSubscription, triggerSubscriptions, noop } from './subscriptions'
 
-const fallbackRunWithContext = (fn: Function) => fn()
+const fallbackRunWithContext = (fn: () => unknown) => fn()
 
 type _ArrayType<AT> = AT extends Array<infer T> ? T : never
 
@@ -481,7 +481,7 @@ function createSetupStore<
   // TODO: idea create skipSerialize that marks properties as non serializable and they are skipped
   const setupStore = pinia._e.run(() => {
     scope = effectScope()
-    return runWithContext(() => scope.run(() => setup()))
+    return runWithContext(() => scope.run(setup))
   })!
 
   // overwrite existing actions to support $onAction