gregwebs / redux-side-effect

simple light-weight side effects for redux
MIT License
27 stars 2 forks source link

Feature suggestion: work with time travel #4

Open mheiber opened 8 years ago

mheiber commented 8 years ago

Nice simple library! If I understand correctly, redux-side-effect (like redux-saga, redux-loop, etc) doesn't currently work well with time travel, since replaying actions also re-calls functions that cause side effects. Is that right?

I think there's a good solution, but want to check with you to see if this is a problem first.

gregwebs commented 8 years ago

I think you can make it work with time travel by having a few special rules

mheiber commented 8 years ago

@gregwebs what do you mean? Thanks for your help as I try to figure this out.

gregwebs commented 8 years ago

I think you need to change the code to recognize when you are in development and doing time travelling. You could for example cache the original response from the side effect and not actually invoke the side effect function the next time around but just use the cached response.