listen<HubEventPayload, E extends HubEvent<HubEventPayload>> abstract method

StreamSubscription<E> listen<HubEventPayload, E extends HubEvent<HubEventPayload>>(
  1. HubChannel<HubEventPayload, E> channel,
  2. HubEventListener<E> listener, {
  3. Function? onError,
})

Listens to the Hub channel for events produced from all plugins in the channel's categories.

Optionally, onError may be specified which will be passed to Stream.listen. It must be of type void Function(Object error) or void Function(Object error, StackTrace).

Implementation

StreamSubscription<E>
    listen<HubEventPayload, E extends HubEvent<HubEventPayload>>(
  HubChannel<HubEventPayload, E> channel,
  HubEventListener<E> listener, {
  Function? onError,
});