EventHandler<T extends VyuhEvent> class final

A typed event listener that a feature declares in FeatureDescriptor.events.

The platform subscribes every handler of a feature when the feature starts, and cancels them when the feature is disposed, when the platform restarts, or when a lazy feature's activation is rolled back. Features never manage these subscriptions themselves.

FeatureDescriptor(
  name: 'auth',
  title: 'Auth',
  events: [
    EventHandler<SystemReadyEvent>((_) => restoreSession()),
    EventHandler<RouteFailureEvent>((e) => log(e.failure)),
  ],
  routes: () => [...],
);

Constructors

EventHandler(VyuhEventListener<T> listener)
Creates a handler for events of type T.
const

Properties

eventType → Type
The event type this handler listens to.
no setter
hashCode → int
The hash code for this object.
no setterinherited
listener → VyuhEventListener<T>
Called for every event of type T.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
subscribe(EventPlugin events) → DisposeFunction
Subscribes listener on events, keeping the generic type T. Used by the platform; features do not call this.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited