select2<T> function

Stream<T> select2 <T>(
  1. T callback(
    1. Map<String, dynamic> state
    )
)

This method takes a callback which has a single Map<String, dynamic> type arg. If you pass Map key as a state name then you will get corresponding model instance as value.

Example

final _message$ = select2<TodoModel>((states) => states['todo'])
   .map((tm) => tm.message)
   .distinct();

Note: You can take any combination from the overall application's state.

Implementation

Stream<T> select2<T>(T callback(Map<String, dynamic> state)) {
  return _store.select2(callback);
}