call method

  1. @override
FutureOr<void> call(
  1. Effect effect,
  2. MsgEmitter<Msg> emit
)
override

Handles an effect with debounce logic.

If an effect is already scheduled for handling, it will be canceled, and the new effect will replace it. After the debounce duration, the latest effect is processed using the wrapped _handler.

  • effect: The effect to be processed after the debounce delay.
  • emit: A function to emit messages resulting from the effect.

Implementation

@override
FutureOr<void> call(
  Effect effect,
  MsgEmitter<Msg> emit,
) {
  _cancelTimer();
  _timer = Timer(duration, () => _handler(effect, emit));
}