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

silent and ignore any dispatch or commit during time-traveling in the dev mode #1463

Open
leoyli opened this Issue Nov 29, 2018 · 0 comments

Comments

Projects
None yet
2 participants
@leoyli

leoyli commented Nov 29, 2018

What problem does this feature solve?

IMO, time-traveling (or traversing in the event sourcing record) should have no side-effects. Often, I found it is annoying when I "time-traveled", there is a side-effect being performed due to the component life cycle or routing middleware try to do their "regular" task... this resulted in a polluted mutation records... Consider the fact that some component can be delayed rendered by v-if=state (so components may be mounted/unmounted during time-traveling), the same may also happen if the one uses @vue/vuex-router-sync, this feature is good to have.

What does the proposed API look like?

When we click "time travel to the state" in the dev tool, Vuex internally have a mechanism to silent and ignore any dispatch or commit to be performed (or prevent state to be mutated during time-traveling). This locking mechanism can be unlocked if we decide to either revert or traverse to the latest state (they are basically the same). While I have little clue how we are going to implement this or should we have this, after discussed with my colleagues, I think it would be beneficial to open this discussion.

** the reason I post this here is due to the fact that the devTool have to touch the vuex core if we want to have this.

@ktsn ktsn added the discussion label Dec 2, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment