addSyncHandler<TEvent extends BlocEvent> method
void
addSyncHandler<TEvent extends BlocEvent>(
- T handler(
- T state,
- 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),
);