Skip to content
This repository has been archived by the owner on Dec 5, 2024. It is now read-only.

fix: Previously set onGlobalSetup executes for next requests. #270

Closed
vaiil opened this issue Oct 15, 2020 · 0 comments
Closed

fix: Previously set onGlobalSetup executes for next requests. #270

vaiil opened this issue Oct 15, 2020 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@vaiil
Copy link
Contributor

vaiil commented Oct 15, 2020

๐Ÿ› The bug
Previously set onGlobalSetup executes for next requests.

๐Ÿ› ๏ธ To reproduce
Steps to reproduce the behavior:
Make new plugin with following code:

import { onGlobalSetup } from "@nuxtjs/composition-api";
export default () => {
  console.log("Plugin initialized");
  onGlobalSetup(() => {
    console.log("Setup runned");
  });
};

and try to reload page few times.
Log would be:

Plugin initialized
Setup runned
Plugin initialized
Setup runned
Setup runned
Plugin initialized
Setup runned
Setup runned
Setup runned

Or you can visit codesandbox with the bug:
https://codesandbox.io/s/tender-dream-6wjvf?file=/plugins/custom-plugin.js:0-183

๐ŸŒˆ Expected behaviour
One call onGlobalSetup for each request.

โ„น๏ธ Additional context
Node version 14
Production build
Latest nuxt (2.14.6) and @nuxtjs/composition-api (0.13.1)

@vaiil vaiil added the bug Something isn't working label Oct 15, 2020
@vaiil vaiil changed the title fix: fix: Previously set onGlobalSetup executes for next requests. Oct 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants