From: Théo LAVAUX Date: Wed, 16 Mar 2022 16:49:37 +0000 (+0100) Subject: docs: update nuxt.js examples in plugins.md (#1150) X-Git-Tag: @pinia/testing@0.0.11~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d6c3cf913bb9d41bfaaa558af15a384e0acf9cc1;p=thirdparty%2Fvuejs%2Fpinia.git docs: update nuxt.js examples in plugins.md (#1150) Co-authored-by: Eduardo San Martin Morote --- diff --git a/packages/docs/core-concepts/plugins.md b/packages/docs/core-concepts/plugins.md index 16927fb1..b832ec8c 100644 --- a/packages/docs/core-concepts/plugins.md +++ b/packages/docs/core-concepts/plugins.md @@ -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 ```