angular_redux 1.2.0 copy "angular_redux: ^1.2.0" to clipboard
angular_redux: ^1.2.0 copied to clipboard

outdated

Bindings to use Redux state management with Angular Dart components

angular_redux.dart #

Bindings between Redux and Angular Dart.

Quick Start #

Add a Store<T> factory:

Store<CounterState> createStore() => Store();

Add a NgStore<T> factory:

NgStore<CounterState> createNgStore(Store<CounterState> store) => NgStore(store);

Make Store<T> and NgStore<T> injectable:

Module(
  provides: [
    FactoryProvider(Store, createStore),
    FactoryProvider(NgStore, createNgStore),
  ],
)

Inject NgStore<T> into a component:

final NgStore<CounterState> _store;

CounterApp(this._store);

Use select<S> function to transform state into stream:

Stream<int> count;

void ngOnInit() {
  count = _store.select((state) => state.count);
}

Use AsyncPipe to render the stream in the template:

<div>
  {{ count | async }}
</div>
4
likes
0
pub points
0%
popularity

Publisher

unverified uploader

Bindings to use Redux state management with Angular Dart components

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

redux, rxdart

More

Packages that depend on angular_redux