I’ve been experimenting with a redux implementation for .net lately and here is the current state.
The core library is quite functional and ready for a bit more serious test drive. There is also a visualizer, redux based, and with a frontend for WPF (other frontends can be added).
Available are two sample apps, Todo which is a WPF/MVVM/redux implementation of TodoMVC. And a dirty Playground sample.
Here are two screenshots from Todo sample and a brief introduction:
The application itself is on the left while visualizer is on the right. Visualizer is further composed of actions list and state|difference display. Above it shows current state after highlighted action. Value “ 1” in visualizer means list item with index 0 (when a list member) and item has an unique key with value 1 (when applicable).
Above the visualizer is showing state difference between the last action and previous one. You can also select any action from the list and click Reset to State which would rewind the state to one after that action.
But why would anybody bother with redux at all? The answer is logging, separation, unit testing and state rewind. Imagine you have an application that crashes – getting all the actions in proper order would give you the ability to reply exactly what user/application was doing until it crashed – even without any user intervention or feedback.
That’s it for a quick introduction. I’ll try to blog more, create more documentation about it, based also on feedback/interest. I’ll try using it in a real project when an occasion appears. Also visualizer can be and probably will be improved. Right now is something that works well enough for start.
Righthand.SharpRedux is open source and hosted on github and libraries will appear soon on NuGet. You can also get the Todo sample as a zip (.net 4.6.2 required),
Immutable types are based on Righthand.Immutable which is also hosted on NuGet. Visual Studio 2017 extension that creates immutable code is available at Marketplace. Righthand.Immutable is optional for SharpRedux and can be used standalone.