https://github.com/romansoloweow/historicalreactivecommand
HistoricalReactiveCommand for ReactiveUI
https://github.com/romansoloweow/historicalreactivecommand
csharp dotnet historical-data reactivecommand reactiveui undo-redo
Last synced: 5 months ago
JSON representation
HistoricalReactiveCommand for ReactiveUI
- Host: GitHub
- URL: https://github.com/romansoloweow/historicalreactivecommand
- Owner: RomanSoloweow
- License: mit
- Created: 2020-08-22T16:46:18.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2022-09-11T22:51:09.000Z (almost 3 years ago)
- Last Synced: 2025-02-02T12:34:45.256Z (5 months ago)
- Topics: csharp, dotnet, historical-data, reactivecommand, reactiveui, undo-redo
- Language: C#
- Homepage:
- Size: 200 KB
- Stars: 7
- Watchers: 1
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/RomanSoloweow/HistoricalReactiveCommand) [](https://github.com/RomanSoloweow/HistoricalReactiveCommand) [](https://github.com/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.