mapTo
signature: mapTo(value: any): Observable
Example 1: Map every emission to string
Example 2: Mapping clicks to string
import { fromEvent } from 'rxjs/observable/fromEvent';
//emit every click on document
//map all emissions to one value
const subscribe = example.subscribe(val => console.log(val));
- mapTo
- Official docs
- John Linquist- Transformation operator: map and mapTo
- André Staltz