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

Run effects that have {dispatch: false} during dev tools time travel. #1235

Closed
codemasterover9000 opened this issue Aug 10, 2018 · 4 comments

Comments

@codemasterover9000
Copy link

Hi,

Would it be possible to allow effects that dont result in state modification to run during time travel? In my case I use such an effect to show a snackbar.

Thanks!

@timdeschryver
Copy link
Member

If I'm not mistaken, effects are ignored for a reason right now (e.g. we don't want to fetch/save the data again).
I think if we want effects to be "replayed", #955 should first be merged.
If the devtools is "locked' it wouldn't dispatch the actions and otherwise it would, at least that's how I'm seeing it.

@codemasterover9000
Copy link
Author

The implementation of #955 would still mean effects won't run in any case if I understand correctly? As we still don't want the side effects to actually run (remote calls etc)? #955 only prevents action dispatch.

I'm also using the action stream as an event system to display messages in my app. This won't work during time travel atm. Maybe this is bad design on my part but I'm not sure how to implement it differently.

@timdeschryver
Copy link
Member

Yea you're correct it won't solve this problem. But it would allow to use the "lock" functionality to prevent effects to be invoked. In other words, if it isn't locked we could invoke effects; if it's locked we could prevent this. But again, that's how I'm seeing it 😅

@brandonroberts
Copy link
Member

Time traveling is for state, and not effects. If you want to trigger an effect this way, you're effect should be listening for a piece of state to change.

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

No branches or pull requests

3 participants