source: trip-planner-front/node_modules/rxjs/internal/operators/reduce.js@ bdd6491

Last change on this file since bdd6491 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 797 bytes
Line 
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3var scan_1 = require("./scan");
4var takeLast_1 = require("./takeLast");
5var defaultIfEmpty_1 = require("./defaultIfEmpty");
6var pipe_1 = require("../util/pipe");
7function reduce(accumulator, seed) {
8 if (arguments.length >= 2) {
9 return function reduceOperatorFunctionWithSeed(source) {
10 return pipe_1.pipe(scan_1.scan(accumulator, seed), takeLast_1.takeLast(1), defaultIfEmpty_1.defaultIfEmpty(seed))(source);
11 };
12 }
13 return function reduceOperatorFunction(source) {
14 return pipe_1.pipe(scan_1.scan(function (acc, value, index) { return accumulator(acc, value, index + 1); }), takeLast_1.takeLast(1))(source);
15 };
16}
17exports.reduce = reduce;
18//# sourceMappingURL=reduce.js.map
Note: See TracBrowser for help on using the repository browser.