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

replaceState should trigger subscribe callbacks #1316

Open
miaulightouch opened this issue Jun 22, 2018 · 5 comments
Open

replaceState should trigger subscribe callbacks #1316

miaulightouch opened this issue Jun 22, 2018 · 5 comments

Comments

@miaulightouch
Copy link

Version

3.0.1

Reproduction link

https://codepen.io/anon/pen/zajRgg?editors=1010

Steps to reproduce

  1. subscribe a callback
  2. replaceState with any object, and subscribe 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/devtools-v6#690

@LinusBorg
Copy link
Member

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.

@rulrok
Copy link

rulrok commented Sep 24, 2018

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).

@ghost
Copy link

ghost commented Dec 10, 2018

Is this a duplicate of #1448 (or the other way round)?

@nek4life
Copy link

nek4life commented Apr 8, 2020

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 vuejs/devtools-v6#690

@MarcelFinkbeiner
Copy link

any updates on this?

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

5 participants