mapTo<S> method

Observable<S> mapTo <S>(S value)

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

Example

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

Implementation

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