This repository has been archived on 2026-03-06. You can view files and clone it, but cannot push or open issues or pull requests.
todo/node_modules/rxjs/dist/cjs/internal/operators/switchScan.js
2025-06-13 14:04:40 +08:00

16 lines
662 B
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.switchScan = void 0;
var switchMap_1 = require("./switchMap");
var lift_1 = require("../util/lift");
function switchScan(accumulator, seed) {
return lift_1.operate(function (source, subscriber) {
var state = seed;
switchMap_1.switchMap(function (value, index) { return accumulator(state, value, index); }, function (_, innerValue) { return ((state = innerValue), innerValue); })(source).subscribe(subscriber);
return function () {
state = null;
};
});
}
exports.switchScan = switchScan;
//# sourceMappingURL=switchScan.js.map