From: Eduardo San Martin Morote Date: Wed, 17 May 2023 08:15:33 +0000 (+0200) Subject: refactor: types X-Git-Tag: @pinia/nuxt@0.4.11~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4570274d1c929efb0eb3e34cd7055f9478d0deb9;p=thirdparty%2Fvuejs%2Fpinia.git refactor: types --- diff --git a/packages/pinia/src/store.ts b/packages/pinia/src/store.ts index 50b15444..3faa689a 100644 --- a/packages/pinia/src/store.ts +++ b/packages/pinia/src/store.ts @@ -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 extends Array ? 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