From bcb4ec3422635dd57f655e58f72a9a7a1c7dba0d Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote Date: Thu, 15 Apr 2021 16:43:14 +0200 Subject: [PATCH] feat(plugins): pass a context object to plugins instead of app BREAKING CHANGE: To improve the plugin api capabilities, `pinia.use()` now receives a context object instead of just `app`: ```js // replace pinia.use((app) => {}) // with pinia.use(({ app }) => {}) ``` --- docs/core-concepts/plugins.md | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 docs/core-concepts/plugins.md diff --git a/docs/core-concepts/plugins.md b/docs/core-concepts/plugins.md deleted file mode 100644 index fb1a413b..00000000 --- a/docs/core-concepts/plugins.md +++ /dev/null @@ -1,17 +0,0 @@ -# Plugins - -Pinia stores can be fully extended thanks to a low level API. Here is a list of things you can do: - -- Add new properties to stores -- Add new methods to stores -- Wrap existing methods -- Change or even cancel actions -- Implement side effects like local storage -- Apply **only** to specific stores - -Plugins are added to pinia with `pinia.use()`: - -```js -// add a property named `secret` to every store that is created after this plugin is installed -pinia.use(() => ({ secret: '' })) -``` -- 2.47.2