mapTo<S> method

Stream<S> mapTo <S>(
  1. S value
)

Emits the given constant value on the output Stream every time the source Stream emits a value.

Example

Stream.fromIterable([1, 2, 3, 4])
  .mapTo(true)
  .listen(print); // prints true, true, true, true

Implementation

Stream<S> mapTo<S>(S value) => transform(MapToStreamTransformer<T, S>(value));