FunEffectHandler<Effect, Msg> typedef

  1. @experimental
FunEffectHandler<Effect, Msg> = FutureOr<void> Function(Effect effect, MsgEmitter<Msg> emit)

A functional representation of an effect handler.

Equivalent to EffectHandler but defined as a function type for simpler usage.

  • Effect: The type of effects handled.
  • Msg: The type of messages emitted.

Implementation

@experimental
typedef FunEffectHandler<Effect, Msg> = FutureOr<void> Function(
  Effect effect,
  MsgEmitter<Msg> emit,
);