HistoricalReactiveCommand for ReactiveUI.
The creation and logic of work is as similar as possible to conventional reactive commands.
int myNumber = 0;
var command = ReactiveCommandEx.CreateWithHistory<int>("adding",
(number) => { myNumber += number; },
(number) => { myNumber -= number; });
//myNumber is 25
command.Execute(25).Subscribe();
//myNumber is 50
command.Execute(25).Subscribe();
//myNumber is 25
command.History.Undo.Execute().Subscribe();
//myNumber is 0
command.History.Undo.Execute().Subscribe();
//myNumber is 25
command.History.Redo.Execute().Subscribe();
//myNumber is 50
command.History.Redo.Execute().Subscribe();
Licensed under the MIT license.