addSyncHandler<TEvent extends BlocEvent> method

void addSyncHandler<TEvent extends BlocEvent>(
  1. T handler(
    1. T state,
    2. TEvent event
    )
)

Add a sync event handler.

Implementation

void addSyncHandler<TEvent extends BlocEvent>(
  T Function(T state, TEvent event) handler,
) =>
    _syncHandlersByEvent.putIfAbsent(
      TEvent,
      () => (s, e) => handler(s, e as TEvent),
    );