subscribeHandler method

Future<Subscribed> subscribeHandler(
  1. String topic,
  2. void onEvent(
    1. Event event
    ), {
  3. SubscribeOptions? options,
})

This subscribes the session to a topic and routes events directly to onEvent without requiring the caller to touch Subscribed.eventStream.

Implementation

Future<Subscribed> subscribeHandler(
  String topic,
  void Function(Event event) onEvent, {
  SubscribeOptions? options,
}) {
  return _subscribe(
    topic,
    options: options,
    configure: (subscribed) => subscribed.onEvent(onEvent),
  );
}