Sha256: 7811ca3fa7e987bfae73ff5c37ee018d16bc19b5da8746eafdb58f921d67abc7

Contents?: true

Size: 1.12 KB

Versions: 49

Compression:

Stored size: 1.12 KB

Contents

import { mapTo as higherOrder } from '../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
 */
export function mapTo(value) {
    return higherOrder(value)(this);
}
//# sourceMappingURL=mapTo.js.map

Version data entries

49 entries across 49 versions & 4 rubygems

Version Path
ilog-0.4.1 node_modules/rxjs/_esm2015/operator/mapTo.js
ilog-0.4.0 node_modules/rxjs/_esm2015/operator/mapTo.js
ilog-0.3.3 node_modules/rxjs/_esm2015/operator/mapTo.js
govuk_publishing_components-18.0.0 node_modules/rxjs/_esm2015/operator/mapTo.js
govuk_publishing_components-17.21.0 node_modules/rxjs/_esm2015/operator/mapTo.js
govuk_publishing_components-17.20.0 node_modules/rxjs/_esm2015/operator/mapTo.js
govuk_publishing_components-17.19.1 node_modules/rxjs/_esm2015/operator/mapTo.js
govuk_publishing_components-17.19.0 node_modules/rxjs/_esm2015/operator/mapTo.js
govuk_publishing_components-17.18.0 node_modules/rxjs/_esm2015/operator/mapTo.js
govuk_publishing_components-17.17.0 node_modules/rxjs/_esm2015/operator/mapTo.js
govuk_publishing_components-17.16.0 node_modules/rxjs/_esm2015/operator/mapTo.js
govuk_publishing_components-17.15.0 node_modules/rxjs/_esm2015/operator/mapTo.js
govuk_publishing_components-17.14.0 node_modules/rxjs/_esm2015/operator/mapTo.js
govuk_publishing_components-17.13.0 node_modules/rxjs/_esm2015/operator/mapTo.js
govuk_publishing_components-17.12.2 node_modules/rxjs/_esm2015/operator/mapTo.js
govuk_publishing_components-17.12.1 node_modules/rxjs/_esm2015/operator/mapTo.js
govuk_publishing_components-17.12.0 node_modules/rxjs/_esm2015/operator/mapTo.js
govuk_publishing_components-17.11.0 node_modules/rxjs/_esm2015/operator/mapTo.js
govuk_publishing_components-17.10.0 node_modules/rxjs/_esm2015/operator/mapTo.js
govuk_publishing_components-17.9.0 node_modules/rxjs/_esm2015/operator/mapTo.js