/HistoricalReactiveCommand

HistoricalReactiveCommand for ReactiveUI

Primary LanguageC#MIT LicenseMIT

HistoricalReactiveCommand

HistoricalReactiveCommand for ReactiveUI.

The creation and logic of work is as similar as possible to conventional reactive commands.

A Compelling Example

Simple command with History

   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();
                      

Licenseđź“‘

Licensed under the MIT license.