reduct 1.0.1 copy "reduct: ^1.0.1" to clipboard
reduct: ^1.0.1 copied to clipboard

An elementary yet adaptable state management solution for Dart.

example/reduct_example.dart

import 'package:reduct/reduct.dart';

void main() {
  // initialize the reducer
  CounterReducer();

  // call increment twice
  incrementAction();
  incrementAction();

  // outputs:
  // My counter: 1
  // My counter: 2
}

// atoms
final counterState = Atom(0);
final incrementAction = Atom.action();

// reducer
class CounterReducer extends Reducer {
  CounterReducer() {
    on(incrementAction, (_) => counterState.value++);
    on(counterState, (value) => print('My counter: $value'));
  }
}
1
likes
160
pub points
41%
popularity

Publisher

verified publishereronsoft.com

An elementary yet adaptable state management solution for Dart.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

More

Packages that depend on reduct