Sha256: d469b78359a08604efcf259268769956d81d51ee297de083ceeef10d6a4df65f

Contents?: true

Size: 1.61 KB

Versions: 49

Compression:

Stored size: 1.61 KB

Contents

import { map as higherOrderMap } from '../operators/map';
/**
 * Applies a given `project` function to each value emitted by the source
 * Observable, and emits the resulting values as an Observable.
 *
 * <span class="informal">Like [Array.prototype.map()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map),
 * it passes each source value through a transformation function to get
 * corresponding output values.</span>
 *
 * <img src="./img/map.png" width="100%">
 *
 * Similar to the well known `Array.prototype.map` function, this operator
 * applies a projection to each value and emits that projection in the output
 * Observable.
 *
 * @example <caption>Map every click to the clientX position of that click</caption>
 * var clicks = Rx.Observable.fromEvent(document, 'click');
 * var positions = clicks.map(ev => ev.clientX);
 * positions.subscribe(x => console.log(x));
 *
 * @see {@link mapTo}
 * @see {@link pluck}
 *
 * @param {function(value: T, index: number): R} project The function to apply
 * to each `value` emitted by the source Observable. The `index` parameter is
 * the number `i` for the i-th emission that has happened since the
 * subscription, starting from the number `0`.
 * @param {any} [thisArg] An optional argument to define what `this` is in the
 * `project` function.
 * @return {Observable<R>} An Observable that emits the values from the source
 * Observable transformed by the given `project` function.
 * @method map
 * @owner Observable
 */
export function map(project, thisArg) {
    return higherOrderMap(project, thisArg)(this);
}
//# sourceMappingURL=map.js.map

Version data entries

49 entries across 49 versions & 4 rubygems

Version Path
govuk_publishing_components-17.8.0 node_modules/rxjs/_esm2015/operator/map.js
govuk_publishing_components-17.7.0 node_modules/rxjs/_esm2015/operator/map.js
govuk_publishing_components-17.6.1 node_modules/rxjs/_esm2015/operator/map.js
govuk_publishing_components-17.6.0 node_modules/rxjs/_esm2015/operator/map.js
govuk_publishing_components-17.5.0 node_modules/rxjs/_esm2015/operator/map.js
govuk_publishing_components-17.4.0 node_modules/rxjs/_esm2015/operator/map.js
govuk_publishing_components-17.3.0 node_modules/rxjs/_esm2015/operator/map.js
govuk_publishing_components-17.2.0 node_modules/rxjs/_esm2015/operator/map.js
govuk_publishing_components-17.1.1 node_modules/rxjs/_esm2015/operator/map.js
govuk_publishing_components-17.1.0 node_modules/rxjs/_esm2015/operator/map.js
govuk_publishing_components-17.0.0 node_modules/rxjs/_esm2015/operator/map.js
govuk_publishing_components-16.29.0 node_modules/rxjs/_esm2015/operator/map.js
govuk_publishing_components-16.28.0 node_modules/rxjs/_esm2015/operator/map.js
govuk_publishing_components-16.27.1 node_modules/rxjs/_esm2015/operator/map.js
govuk_publishing_components-16.27.0 node_modules/rxjs/_esm2015/operator/map.js
govuk_publishing_components-16.26.0 node_modules/rxjs/_esm2015/operator/map.js
govuk_publishing_components-16.25.0 node_modules/rxjs/_esm2015/operator/map.js
govuk_publishing_components-16.24.0 node_modules/rxjs/_esm2015/operator/map.js
govuk_publishing_components-16.23.0 node_modules/rxjs/_esm2015/operator/map.js
govuk_publishing_components-16.22.0 node_modules/rxjs/_esm2015/operator/map.js