marcglasberg / async_redux

Flutter Package: A Redux version tailored for Flutter, which is easy to learn, to use, to test, and has no boilerplate. Allows for both sync and async reducers.
Other
234 stars 40 forks source link

Roadmap Question #50

Closed doc-rj-celltrak closed 4 years ago

doc-rj-celltrak commented 4 years ago

Hi, I'm new to Redux but this package looks very nice, so thank you! I have a question about plans for enhancements. One thing this package doesn't seem to support is redux_dev_tools and flutter_redux_dev_tools, since they require replacing the store with a dev store for "time travel" for purposes of development and testing. As I said, I'm new to Redux but that dev feature sounds very compelling and Redux architecture in general seems like a great fit for it. Do you have any plans to support "time travel" in this library? No worries if not, but if so, I think it would be yet another benefit of using this package. Having said that, I could be wrong. Maybe "time travel" isn't used very often at all by Redux devs? Thanks in advance for your thoughts on this, and thanks for the awesome library.

marcglasberg commented 4 years ago

I never really saw someone using Redux time travel in the wild. It seems to me more like something to demonstrate the immutable state single-store concept. But, I could be wrong.

In any case you can do time-travel with AsyncRedux already. Just create a state-observer (pass it in the store constructor) and save every state to a list. Or to a map indexed by a timestamp. You can then inspect any state, or go back to any state you want.

But testing should not be done like this. AsyncRedux does have advanced testing capabilities. Please have a look at the StoreTester class. It does save state changes and lets you check whatever changes you need.

doc-rj-celltrak commented 4 years ago

Thanks @marcglasberg for your response. That sounds good and I do agree that "time travel" shouldn't be used for testing. I guess it's more often used for replaying/reproducing issues and debugging them. Anyhow, thanks and we will be using your library.