Time-travel and hot reloading
See original GitHub issueSuppose we have a saga to handle authentication of an user like in your example.
What bothers me is that I’m not sure the behavior would be correct when associated with time-travel debugging. I mean if the saga has an initial variable let userConnected = false
, then the user connects so userConnected = true
, and then we time travel back to the beginning. Here the saga will still have userConnected = true
right?
But I’m not sure it’s actually a problem as this project is a middleware and what I understand of Redux devtools is that during time travel the actions do not go through the middleware chain again so the saga would not change state.
What about hot reloading of Saga code? I’m not sure here it will work at all either but not sure it is really possible to do something nice about it right?
Issue Analytics
- State:
- Created 8 years ago
- Reactions:8
- Comments:18 (7 by maintainers)
Top GitHub Comments
I agree. Just pausing existing sagas and restarting hot reloaded ones would cover most cases where you’d care about hot reloading them, in my opinion. Sure, it’s not perfect, but it’s better than nothing, isn’t it?
I’m more concerned about state that the sagas have. I mean if you have a long-lived saga and it uses local variables, then when we time-travel it’s not easy to update this state accordingly, and worse the saga also has some kind of “progress state” (I mean at which execution point the Saga is currently).
Generators seems to allow an user-friendly syntax but also seems to introduce some kind of implicit state and I don’t really see how to deal with that.