once<T extends VyuhEvent> abstract method
Subscribe to a single occurrence of an event of type T
.
The listener
will be called only once when an event of type T
is emitted, then the subscription will be automatically cancelled.
Example:
vyuh.event.once<AppStartEvent>((event) {
print('App started at ${event.timestamp}');
});
Implementation
void once<T extends VyuhEvent>(VyuhEventListener<T> listener);