On<State, Action extends StoreAction> class Null safety

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.
read-onlyinherited
reducer ActionReducer<State, Action>
final
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited

Methods

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

Operators

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