Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/romansoloweow/historicalreactivecommand

HistoricalReactiveCommand for ReactiveUI
https://github.com/romansoloweow/historicalreactivecommand

csharp dotnet historical-data reactivecommand reactiveui undo-redo

Last synced: 4 months ago
JSON representation

HistoricalReactiveCommand for ReactiveUI

Awesome Lists containing this project

README

        

[![](https://img.shields.io/github/stars/RomanSoloweow/HistoricalReactiveCommand)](https://github.com/RomanSoloweow/HistoricalReactiveCommand) [![](https://img.shields.io/github/languages/code-size/RomanSoloweow/HistoricalReactiveCommand)](https://github.com/RomanSoloweow/HistoricalReactiveCommand) [![]( https://img.shields.io/github/last-commit/RomanSoloweow/HistoricalReactiveCommand/master)](https://github.com/RomanSoloweow/HistoricalReactiveCommand) [![](https://img.shields.io/github/license/RomanSoloweow/HistoricalReactiveCommand)](https://github.com/RomanSoloweow/HistoricalReactiveCommand)
# HistoricalReactiveCommand
HistoricalReactiveCommand for [ReactiveUI](https://github.com/reactiveui/ReactiveUI).

The creation and logic of work is as similar as possible to conventional [reactive commands](https://www.reactiveui.net/docs/handbook/commands/).

# A Compelling Example
## Simple command with History
```C#
int myNumber = 0;
var command = ReactiveCommandEx.CreateWithHistory("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) license.