Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/romansoloweow/historicalreactivecommand
- Owner: RomanSoloweow
- License: mit
- Created: 2020-08-22T16:46:18.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-09-11T22:51:09.000Z (over 2 years ago)
- Last Synced: 2024-10-10T07:27:01.083Z (4 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://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.