mapTo
signature: mapTo(value: any): Observable
mapTo(value: any): Observable
Map emissions to constant value.
New to transformation operators? Check out the article Get started transforming streams with map, pluck, and mapTo!
Examples
Example 1: Map every emission to string
( StackBlitz | jsBin | jsFiddle )
Example 2: Mapping clicks to string
( StackBlitz | jsBin | jsFiddle )
Related Recipes
Additional Resources
mapTo π° - Official docs
Changing behavior with mapTo π₯ π΅ - John Linquist
Transformation operator: map and mapTo π₯ π΅ - AndrΓ© Staltz
π Source Code: https://github.com/ReactiveX/rxjs/blob/master/src/internal/operators/mapTo.ts
Last updated