On<State, Action extends StoreAction> class

A special type of reducer object that will only run for a specific StoreAction.

Example

Reducer<int> counterReducer = createReducer([
  On<int, IncrementCounterAction>(
    (counter, action) => counter + 1,
  ),
  On<int, DecrementCounterAction>(
    (counter, action) => counter - 1,
  ),
]);

Constructors

On(ActionReducer<State, Action> reducer)

Properties

hashCode int
The hash code for this object.
no setterinherited
reducer ActionReducer<State, Action>
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

call(State state, dynamic action) → State
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited