]> git.ipfire.org Git - thirdparty/vuejs/pinia.git/commitdiff
docs: update DefineStoreOptions in plugin section
authorEduardo San Martin Morote <posva13@gmail.com>
Wed, 29 Sep 2021 09:08:04 +0000 (11:08 +0200)
committerEduardo San Martin Morote <posva13@gmail.com>
Wed, 29 Sep 2021 09:08:04 +0000 (11:08 +0200)
packages/docs/core-concepts/plugins.md

index d0a19c8afed374d1c96c7caf76e164e80007fd00..028d278cd7cf7d4866108dd0b234857e6b9f6cb1 100644 (file)
@@ -343,14 +343,16 @@ import 'pinia'
 
 declare module 'pinia' {
   export interface DefineStoreOptionsBase<S, Store> {
-    debounce?: {
-      // allow defining a number of ms for any of the actions
-      [k in keyof A]?: number
-    }
+    // allow defining a number of ms for any of the actions
+    debounce?: Partial<Record<keyof StoreActions<Store>, number>>
   }
 }
 ```
 
+:::tip
+There is also a `StoreGetters` type to extract the _getters_ from a Store type. You can also extend the options of _setup stores_ or _option stores_ **only** by extending the types `DefineStoreOptions` and `DefineSetupStoreOptions` respectively.
+:::
+
 ## Nuxt.js
 
 When [using pinia alongside Nuxt](../ssr/nuxt.md), you will have to create a [Nuxt plugin](https://nuxtjs.org/docs/2.x/directory-structure/plugins) first. This will give you access to the `pinia` instance: