on<T> method

Stream<T> on<T>()

Implementation

Stream<T> on<T>() {
  if (T == dynamic) {
    return streamController.stream as Stream<T>;
  } else {
    return streamController.stream.where((event) => event is T).cast<T>();
  }
}