addInitial method

Stream<T> addInitial(
  1. T initial
)

Implementation

Stream<T> addInitial(T initial) {
  final controller = StreamController<T>();
  controller.onCancel = () {
    controller.close();
  };
  controller.onListen = () {
    controller.add(initial);
    controller.addStream(this);
  };
  return controller.stream;
}