From: Eduardo San Martin Morote Date: Mon, 3 May 2021 08:55:42 +0000 (+0200) Subject: refactor: correctly use DefineStoreOptions X-Git-Tag: v0.4.0~10 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a2fafc5c60996187dc34aaf1e5af2fcd62cead25;p=thirdparty%2Fvuejs%2Fpinia.git refactor: correctly use DefineStoreOptions --- diff --git a/src/index.ts b/src/index.ts index bffa8907..1bbc646b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -12,11 +12,11 @@ export { Store, StoreDefinition, GenericStore, - GenericStoreDefinition, StoreWithGetters, StoreWithActions, StoreWithState, PiniaCustomProperties, + DefineStoreOptions, } from './types' export { diff --git a/src/store.ts b/src/store.ts index 1c74e20d..d991aae5 100644 --- a/src/store.ts +++ b/src/store.ts @@ -269,20 +269,7 @@ export function defineStore< S extends StateTree, G extends GettersTree, A /* extends Record */ ->(options: { - id: Id - state?: () => S - getters?: G & ThisType & PiniaCustomProperties> - // allow actions use other actions - actions?: A & - ThisType< - A & - S & - StoreWithState & - StoreWithGetters & - PiniaCustomProperties - > -}): StoreDefinition { +>(options: DefineStoreOptions): StoreDefinition { const { id, state, getters, actions } = options function useStore(pinia?: Pinia | null): Store {