]> git.ipfire.org Git - thirdparty/vuejs/pinia.git/commitdiff
refactor: correctly use DefineStoreOptions
authorEduardo San Martin Morote <posva13@gmail.com>
Mon, 3 May 2021 08:55:42 +0000 (10:55 +0200)
committerEduardo San Martin Morote <posva13@gmail.com>
Mon, 3 May 2021 09:08:12 +0000 (11:08 +0200)
src/index.ts
src/store.ts

index bffa890714e62878ea60b9f107d4ede5dc3ad234..1bbc646bec19d313630e16ec6a947488fe4b2120 100644 (file)
@@ -12,11 +12,11 @@ export {
   Store,
   StoreDefinition,
   GenericStore,
-  GenericStoreDefinition,
   StoreWithGetters,
   StoreWithActions,
   StoreWithState,
   PiniaCustomProperties,
+  DefineStoreOptions,
 } from './types'
 
 export {
index 1c74e20d7cf853ab7a864852521fc44177f45182..d991aae530c08fdb493a2e6df669a5eb2858eb72 100644 (file)
@@ -269,20 +269,7 @@ export function defineStore<
   S extends StateTree,
   G extends GettersTree<S>,
   A /* extends Record<string, StoreAction> */
->(options: {
-  id: Id
-  state?: () => S
-  getters?: G & ThisType<S & StoreWithGetters<G> & PiniaCustomProperties>
-  // allow actions use other actions
-  actions?: A &
-    ThisType<
-      A &
-        S &
-        StoreWithState<Id, S> &
-        StoreWithGetters<G> &
-        PiniaCustomProperties
-    >
-}): StoreDefinition<Id, S, G, A> {
+>(options: DefineStoreOptions<Id, S, G, A>): StoreDefinition<Id, S, G, A> {
   const { id, state, getters, actions } = options
 
   function useStore(pinia?: Pinia | null): Store<Id, S, G, A> {