onReady method

StreamSubscription<Map<HostEventType, dynamic>> onReady({
  1. required HostReadyHandler handler,
})
inherited

Implementation

StreamSubscription<Map<HostEventType, dynamic>> onReady({required handler}) {
  var subsription = h.eventStream.listen((event) {
    if (event.containsKey(HostEventType.ready))
      handler(hostId: event.values.first);
  });
  h.readyListenerHandlers
      .update(handler, (value) => subsription, ifAbsent: () => subsription);
  return subsription;
}