Skip to content

RomanSoloweow/HistoricalReactiveCommand

Repository files navigation

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.

Releases

No releases published

Packages

No packages published

Languages