Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shindakioku/incredux
https://github.com/shindakioku/incredux
Last synced: 5 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/shindakioku/incredux
- Owner: shindakioku
- License: bsd-3-clause
- Created: 2019-01-01T19:27:04.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-01-02T10:04:32.000Z (about 6 years ago)
- Last Synced: 2023-08-20T22:28:38.758Z (over 1 year ago)
- Language: Dart
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# incredux
Created from templates made available by Stagehand under a BSD-style
[license](https://github.com/dart-lang/stagehand/blob/master/LICENSE).## Usage
A simple usage example:
```dart
import 'package:redux/redux.dart';
import 'package:incredux/incredux.dart';enum Actions { increment, decrement }
void main() {
when(Actions.increment, (store) => print('(Increment) state: ${store.state}'));when( Actions.decrement, (store) => print('(Decrement) state: ${store.state}'));
int counterReducer(int state, dynamic action) {
if (action == Actions.increment) {
return state + 1;
} else if (action == Actions.decrement) {
return state - 1;
}return state;
}var store = Store(
counterReducer,
initialState: 0,
middleware: >[
incredux()
],
);store.dispatch(Actions.increment); // Print: `(Increment) state: 1`
store.dispatch(Actions.decrement); // Print: `(Increment) state: 0` - because did call increment before
}
```## Features and bugs
Please file feature requests and bugs at the [issue tracker][tracker].
[tracker]: https://github.com/shindakioku/incredux/issues