Code coverage report for RxJS/dist/cjs/operators/concatMap.js

Statements: 83.33% (5 / 6)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 83.33% (5 / 6)      Ignored: none     

All files » RxJS/dist/cjs/operators/ » concatMap.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32    1 1   1                                           1       1
'use strict';
 
exports.__esModule = true;
exports['default'] = concatMap;
 
var _mergeMapSupport = require('./mergeMap-support');
 
/**
 * Maps values from the source observable into new Observables, then merges them in a serialized fashion,
 * waiting for each one to complete before merging the next.
 *
 * __Warning:__ if incoming values arrive endlessly and faster than the observables they're being mapped
 * to can complete, it will result in memory issues as created observables amass in an unbounded buffer
 * waiting for their turn to be subscribed to.
 *
 * @param {function} project a function to map incoming values into Observables to be concatenated. accepts
 * the `value` and the `index` as arguments.
 * @param {function} [projectResult] an optional result selector that is applied to values before they're
 * merged into the returned observable. The arguments passed to this function are:
 * - `outerValue`: the value that came from the source
 * - `innerValue`: the value that came from the projected Observable
 * - `outerIndex`: the "index" of the value that came from the source
 * - `innerIndex`: the "index" of the value from the projected Observable
 * @returns {Observable} an observable of values merged from the projected Observables as they were subscribed to,
 * one at a time. Optionally, these values may have been projected from a passed `projectResult` argument.
 */
 
function concatMap(project, projectResult) {
  return this.lift(new _mergeMapSupport.MergeMapOperator(project, projectResult, 1));
}
 
module.exports = exports['default'];