listen<R, C extends FutureChange<R>> method

Stream<R> listen<R, C extends FutureChange<R>>()

Listen to changes of exact type

Implementation

Stream<R> listen<R, C extends FutureChange<R>>() {
  for (final p in _performers) {
    try {
      if (p is Broadcast<R, C>) {
        return p.broadcast;
      } else {
        continue;
      }
      // ignore: avoid_catching_errors
    } on TypeError catch (e) {
      debugPrint(e.toString());
      continue;
    } on Exception catch (e) {
      return Stream.error(e);
    }
  }

  return Stream.error(NoBroadcastPerformerException(C));
}