mapTo<T> method

Stream<T> mapTo <T>(
  1. T 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<T> mapTo<T>(T value) => transform(MapToStreamTransformer(value));