onState<S> method

void onState <S>(
  1. dynamic handler(
    1. S state
    )
)

Used to attach a handler whenever a state update for S occurs.

  onState<TodosLoadedState>(_updateStats);

Handlers will be disposed automatically by the BaseLogic dispose method.

Implementation

void onState<S>(Function(S state) handler) {
  channel.output.onState<S>(this, handler);
}