onDroppable<E extends Event> method

void onDroppable<E extends Event>(
  1. EventHandler<E, State> handler
)

A helper method to register an event handler with a droppable throttling transformer.

This means:

  • If multiple events of type E are fired quickly, only the first one will be handled.
  • Any subsequent events during the throttleDuration are dropped.

E - The type of the event to handle.

handler - The function that handles the event.

Implementation

void onDroppable<E extends Event>(EventHandler<E, State> handler) {
  on<E>(
    handler,
    transformer: throttleDroppable(throttleDuration),
  );
}