]> git.ipfire.org Git - thirdparty/vuejs/pinia.git/commitdiff
feat(pinia): allow chaining pinia.use
authorEduardo San Martin Morote <posva13@gmail.com>
Mon, 3 May 2021 08:32:31 +0000 (10:32 +0200)
committerEduardo San Martin Morote <posva13@gmail.com>
Mon, 3 May 2021 09:08:12 +0000 (11:08 +0200)
src/rootStore.ts

index 24df34cddaed0b349fd115b25c7aad3ebf5c00c6..82236032d5e8ab7b4c9a6863b9b3db2485fe7b17 100644 (file)
@@ -51,7 +51,7 @@ export interface Pinia {
    *
    * @param plugin - store plugin to add
    */
-  use(plugin: PiniaStorePlugin): void
+  use(plugin: PiniaStorePlugin): Pinia
 
   /**
    * Installed store plugins
@@ -109,6 +109,7 @@ export function createPinia(): Pinia {
 
     use(plugin) {
       _p.push(plugin)
+      return pinia
     },
 
     _p,