mapTo

signature: mapTo(value: any): Observable

Example 1: Map every emission to string
Example 2: Mapping clicks to string
  1. import { fromEvent } from 'rxjs/observable/fromEvent';
  2. //emit every click on document
  3. //map all emissions to one value
  4. const subscribe = example.subscribe(val => console.log(val));