Sha256: 95925c134cfd09cad1b4e3da4cc701bfaf1b26e5e8676a4a73f58984c9850032
Contents?: true
Size: 1.14 KB
Versions: 49
Compression:
Stored size: 1.14 KB
Contents
"use strict"; var mapTo_1 = require('../operators/mapTo'); /** * Emits the given constant value on the output Observable every time the source * Observable emits a value. * * <span class="informal">Like {@link map}, but it maps every source value to * the same output value every time.</span> * * <img src="./img/mapTo.png" width="100%"> * * Takes a constant `value` as argument, and emits that whenever the source * Observable emits a value. In other words, ignores the actual source value, * and simply uses the emission moment to know when to emit the given `value`. * * @example <caption>Map every click to the string 'Hi'</caption> * var clicks = Rx.Observable.fromEvent(document, 'click'); * var greetings = clicks.mapTo('Hi'); * greetings.subscribe(x => console.log(x)); * * @see {@link map} * * @param {any} value The value to map each source value to. * @return {Observable} An Observable that emits the given `value` every time * the source Observable emits something. * @method mapTo * @owner Observable */ function mapTo(value) { return mapTo_1.mapTo(value)(this); } exports.mapTo = mapTo; //# sourceMappingURL=mapTo.js.map
Version data entries
49 entries across 49 versions & 4 rubygems