cast<S> method

Transforms each event.

It extends the current builder by converting the input T using the provided mapper function into output S. Only events of type S will reach the EventHandler.

Implementation

EventSubscriptionBuilder<S> cast<S>() {
  return _MapEventSubscriptionBuilder(
    parent: this,
    mapper: (input) => input as S,
  );
}