Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

postMessage and addEventListener once #18

Open
ahmader opened this issue May 27, 2020 · 1 comment
Open

postMessage and addEventListener once #18

ahmader opened this issue May 27, 2020 · 1 comment

Comments

@ahmader
Copy link

ahmader commented May 27, 2020

window.addEventListener('message', receiveMessage, {
once: true,
});

Because I am running Vue dev-tools, and it is sending messages for hot reload, I was confused. Sometimes I receive the token and most of the time I was not.

After debugging I've found adding once was not a good idea, instead I removeEventListener after receiving the token.

@w3cj
Copy link
Member

w3cj commented Jun 18, 2020

That makes sense. Feel free to make a pull request with the changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants