vuex
vuex copied to clipboard
replaceState should trigger subscribe callbacks
Version
3.0.1
Reproduction link
https://codepen.io/anon/pen/zajRgg?editors=1010
Steps to reproduce
-
subscribe
a callback -
replaceState
with any object, andsubscribe
wouldn't be triggered
What is expected?
subscribe
should be triggered
What is actually happening?
it's not.
if replaceState
won't fire subscribe
callback, vue-devtools would not work properly.
ref: vuejs/vue-devtools#690
I see the issue in dev-tools, but think we need a different solution than running subscribe
callbacks here.
subscribe
is supposed to run when a mutation was committed. When we call replaceState
, no mutation is being committed, so it's correct that this callback is not running.
I agree that we need a way of getting informed when the state has been replaced.
The lack of this capability is making life difficult with vuex-persisted
plugin on production mode (i.e, no scrict
mode).
Is this a duplicate of https://github.com/vuejs/vuex/issues/1448 (or the other way round)?
Any movement on this? It's a bit confusing in the dev tools when calling replaceState and they do not update correctly. I looked in the devtools repo and saw this issue https://github.com/vuejs/vue-devtools/issues/690
any updates on this?