]> git.ipfire.org Git - thirdparty/vuejs/pinia.git/commitdiff
docs: update nuxt.js examples in plugins.md (#1150)
authorThéo LAVAUX <lavauxtheo@gmail.com>
Wed, 16 Mar 2022 16:49:37 +0000 (17:49 +0100)
committerGitHub <noreply@github.com>
Wed, 16 Mar 2022 16:49:37 +0000 (17:49 +0100)
Co-authored-by: Eduardo San Martin Morote <posva@users.noreply.github.com>
packages/docs/core-concepts/plugins.md

index 16927fb128744c76909f418681a9d59e9f7ae910..b832ec8cd5f1132bbafe04928477a4212459496e 100644 (file)
@@ -371,12 +371,14 @@ function MyPiniaPlugin({ store }: PiniaPluginContext) {
     console.log(`[🍍 ${mutation.storeId}]: ${mutation.type}.`)
   })
 
+  // Note this has to be typed if you are using TS
   return { creationTime: new Date() }
 }
 
-const myPlugin: Plugin = ({ pinia }) {
-  pinia.use(MyPiniaPlugin);
+const myPlugin: Plugin = ({ $pinia }) => {
+  $pinia.use(MyPiniaPlugin)
 }
+
 export default myPlugin
 ```