]> git.ipfire.org Git - thirdparty/vuejs/pinia.git/commitdiff
feat(plugins): pass a context object to plugins instead of app
authorEduardo San Martin Morote <posva13@gmail.com>
Thu, 15 Apr 2021 14:43:14 +0000 (16:43 +0200)
committerEduardo San Martin Morote <posva13@gmail.com>
Thu, 15 Apr 2021 14:43:14 +0000 (16:43 +0200)
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 [deleted file]

diff --git a/docs/core-concepts/plugins.md b/docs/core-concepts/plugins.md
deleted file mode 100644 (file)
index fb1a413..0000000
+++ /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: '' }))
-```