Odonno / ReduxSimple

Simple Stupid Redux Store using Reactive Extensions
http://www.nuget.org/packages/ReduxSimple/
MIT License
143 stars 19 forks source link

Adding ReduxStoreWithHistory to allow undo/redo operations. #9

Closed mhusainisurge closed 6 years ago

mhusainisurge commented 6 years ago

We can iterate over the design a bit, but this will accomplish what #1 asks for.

Odonno commented 6 years ago

https://media.giphy.com/media/TBvEYkHRUKBWM/giphy.gif

Wow. Thank you for taking the lead on what I can call the largest PR of the history of this project. :)

Of course, there will be iteration on it but for now, it's a great start. Already made some comments we can discuss.

mhusainisurge commented 6 years ago

Made some changes based on your comments. I had to keep a version of the GoToStep method since the base class is not capable of dealing with an undo operation, which is not a traditional reduce operation.

Another difference is that previously _actionSubject was emitting before _stateSubject and now that order is reversed. I wasn't sure if that order was significant or not, but if it is, I can try to enforce it as well (a little bit more work than what I have now, but nothing that can't be managed).

Odonno commented 6 years ago

About the order of Subject publication, I don't think the order matters. What is important is that they should be published at the same time, one after another, and that is still the case.