startWithStream method

Stream<T> startWithStream(
  1. Stream<T> initial
)

Emits all values and errors in initial before any values or errors from this stream.

If this stream is a broadcast stream the result will be as well. If this stream is a broadcast stream it will miss any events which occur before initial closes.

Implementation

Stream<T> startWithStream(Stream<T> initial) {
  if (isBroadcast && !initial.isBroadcast) {
    initial = initial.asBroadcastStream();
  }
  return initial.followedBy(this);
}