wishthis/node_modules/rxjs/dist/esm5/internal/operators/scanInternals.js
2022-06-08 12:36:39 +02:00

22 lines
No EOL
822 B
JavaScript

import { createOperatorSubscriber } from './OperatorSubscriber';
export function scanInternals(accumulator, seed, hasSeed, emitOnNext, emitBeforeComplete) {
return function (source, subscriber) {
var hasState = hasSeed;
var state = seed;
var index = 0;
source.subscribe(createOperatorSubscriber(subscriber, function (value) {
var i = index++;
state = hasState
?
accumulator(state, value, i)
:
((hasState = true), value);
emitOnNext && subscriber.next(state);
}, emitBeforeComplete &&
(function () {
hasState && subscriber.next(state);
subscriber.complete();
})));
};
}
//# sourceMappingURL=scanInternals.js.map