]> git.ipfire.org Git - thirdparty/vuejs/pinia.git/commitdiff
refactor: use PiniaPlugin
authorEduardo San Martin Morote <posva13@gmail.com>
Wed, 3 Nov 2021 15:14:16 +0000 (16:14 +0100)
committerEduardo San Martin Morote <posva13@gmail.com>
Wed, 3 Nov 2021 15:14:16 +0000 (16:14 +0100)
packages/docs/cookbook/migration-v1-v2.md
packages/pinia/src/createPinia.ts
packages/pinia/src/rootStore.ts
packages/testing/src/testing.ts

index 23a6239b5a4b45813d285926c6af668dc3458d02..36aca78a79c2e836386c3d631a716a1324d2102b 100644 (file)
@@ -63,7 +63,7 @@ If you were writing plugins, using TypeScript, and extending the type `DefineSto
 
 ## `PiniaStorePLugin` was renamed
 
-The type `PiniaStorePlugin` was renamed to `PiniaPlugin`
+The type `PiniaStorePlugin` was renamed to `PiniaPlugin`.
 
 ```diff
 -import { PiniaStorePlugin } from 'pinia'
index 4b362c6f4f61291364e56a8a5d0c9f3812ac9a36..acd9761243a5f2cc01fef85ebd2c45f48b48f846 100644 (file)
@@ -1,9 +1,4 @@
-import {
-  Pinia,
-  PiniaStorePlugin,
-  setActivePinia,
-  piniaSymbol,
-} from './rootStore'
+import { Pinia, PiniaPlugin, setActivePinia, piniaSymbol } from './rootStore'
 import { ref, App, markRaw, effectScope, isVue2 } from 'vue-demi'
 import { registerPiniaDevtools, devtoolsPlugin } from './devtools'
 import { IS_CLIENT } from './env'
@@ -20,7 +15,7 @@ export function createPinia(): Pinia {
 
   let _p: Pinia['_p'] = []
   // plugins added before calling app.use(pinia)
-  let toBeInstalled: PiniaStorePlugin[] = []
+  let toBeInstalled: PiniaPlugin[] = []
 
   const pinia: Pinia = markRaw({
     install(app: App) {
index e2be8960fb96ae58c04a0f8a65ddb091e7803603..833566dd18396c3233d697ed11effdc8fbf0a030 100644 (file)
@@ -4,7 +4,6 @@ import {
   getCurrentInstance,
   inject,
   InjectionKey,
-  Plugin,
   Ref,
 } from 'vue-demi'
 import {
@@ -56,14 +55,14 @@ export interface Pinia {
    *
    * @param plugin - store plugin to add
    */
-  use(plugin: PiniaStorePlugin): Pinia
+  use(plugin: PiniaPlugin): Pinia
 
   /**
    * Installed store plugins
    *
    * @internal
    */
-  _p: Array<PiniaStorePlugin>
+  _p: PiniaPlugin[]
 
   /**
    * App linked to this Pinia instance
index 7a292bc5edab01aba0b646b8f81047d76fc299ae..8bd35fe143778805ec740ba40ba76ba7d2cac91b 100644 (file)
@@ -1,12 +1,12 @@
 import { App, createApp } from 'vue-demi'
-import { Pinia, PiniaStorePlugin, setActivePinia, createPinia } from 'pinia'
+import { Pinia, PiniaPlugin, setActivePinia, createPinia } from 'pinia'
 
 export interface TestingOptions {
   /**
    * Plugins to be installed before the testing plugin. Add any plugins used in
    * your application that will be used while testing.
    */
-  plugins?: PiniaStorePlugin[]
+  plugins?: PiniaPlugin[]
 
   /**
    * When set to false, actions are only spied, they still get executed. When