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

How to prevent action dispatch during time travel with router-store #1196

Closed
codemasterover9000 opened this issue Jul 24, 2018 · 1 comment
Closed

Comments

@codemasterover9000
Copy link

Hi,

I am rewriting an existing app to use ngrx. In the app there are components instantiated through route changes that load data in ngOnInit(). I replaced this with an action dispatch. Problem is that when using time travel in dev-tools with router-store the action get dispatched again through the actual init code of the component.

I thought of using an effect and hooking into router events but I'm not sure if this is the right way to handle this.

So my question is how does one handle this case?

Thanks!

@dummdidumm
Copy link
Contributor

Once #955 gets merged you can use "lock" to ignore all new actions, so time traveling will work without disturbance.

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

3 participants