diff --git a/docs/content/en/hooks.md b/docs/content/en/hooks.md index d455ec0d..05123071 100644 --- a/docs/content/en/hooks.md +++ b/docs/content/en/hooks.md @@ -17,4 +17,43 @@ export default ({ $strapi, app }) => { app.$toast.error(e.message) }) } -``` \ No newline at end of file +``` + +### `userUpdated` + +You can register an `userUpdated` hook to force refetch inside components: + + +```vue{}[components/navbar.vue] + + + +``` diff --git a/lib/plugin.js b/lib/plugin.js index e2f3e035..b1ff6bdc 100644 --- a/lib/plugin.js +++ b/lib/plugin.js @@ -99,6 +99,7 @@ class Strapi extends Hookable { setUser (user) { this.user = user + this.callHook('userUpdated', user) } find (entity, searchParams) {