Sha256: 6b5e66813b461bbcc5fa2746a3dfaf8c54786a8558ffd1c17c97db59c64c0d3e

Contents?: true

Size: 1.67 KB

Versions: 49

Compression:

Stored size: 1.67 KB

Contents

/** PURE_IMPORTS_START .._operators_map PURE_IMPORTS_END */
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
ilog-0.4.1 node_modules/rxjs/_esm5/operator/map.js
ilog-0.4.0 node_modules/rxjs/_esm5/operator/map.js
ilog-0.3.3 node_modules/rxjs/_esm5/operator/map.js
govuk_publishing_components-18.0.0 node_modules/rxjs/_esm5/operator/map.js
govuk_publishing_components-17.21.0 node_modules/rxjs/_esm5/operator/map.js
govuk_publishing_components-17.20.0 node_modules/rxjs/_esm5/operator/map.js
govuk_publishing_components-17.19.1 node_modules/rxjs/_esm5/operator/map.js
govuk_publishing_components-17.19.0 node_modules/rxjs/_esm5/operator/map.js
govuk_publishing_components-17.18.0 node_modules/rxjs/_esm5/operator/map.js
govuk_publishing_components-17.17.0 node_modules/rxjs/_esm5/operator/map.js
govuk_publishing_components-17.16.0 node_modules/rxjs/_esm5/operator/map.js
govuk_publishing_components-17.15.0 node_modules/rxjs/_esm5/operator/map.js
govuk_publishing_components-17.14.0 node_modules/rxjs/_esm5/operator/map.js
govuk_publishing_components-17.13.0 node_modules/rxjs/_esm5/operator/map.js
govuk_publishing_components-17.12.2 node_modules/rxjs/_esm5/operator/map.js
govuk_publishing_components-17.12.1 node_modules/rxjs/_esm5/operator/map.js
govuk_publishing_components-17.12.0 node_modules/rxjs/_esm5/operator/map.js
govuk_publishing_components-17.11.0 node_modules/rxjs/_esm5/operator/map.js
govuk_publishing_components-17.10.0 node_modules/rxjs/_esm5/operator/map.js
govuk_publishing_components-17.9.0 node_modules/rxjs/_esm5/operator/map.js