-
-
Notifications
You must be signed in to change notification settings - Fork 975
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
Every mutation is announced twice when the Vue.js devtools are active #429
Comments
This shouldn't happen nor affect |
As a workaround, use a regular watcher on the |
Found the culprit with how the |
@posva Thank you for the quick investigation and fix! That's awesome! |
Reproduction
Serve the following HTML, e.g., with
npx serve
.(I was unable to get the Vue.js devtools to work within JSFiddle or Codepen, unfortunately.)
Steps to reproduce the behavior
"main" store installed
Expected behavior
Only one log message is printed for each button click, like before.
In other words, the
store.$subscribe
callback is only invoked once for each store mutation.Actual behavior
From now on, with the devtools active, the
store.$subscribe
callback is invoked twice for each mutation, causing two log entries per click. Even more, the timeline in the Vue.js devtools also reports two mutation events for each click.Additional information
Vue: 3.0.11
Pinia: 2.0.0-alpha.11
Vue.js devtools (Chrome): 6.0.0 beta 7
Not sure if this is just an accepted odd behavior with the devtools integration at this early stage, but at least I was fairly confused and could not make the connection to the active devtools until very late.
The text was updated successfully, but these errors were encountered: