This commit is contained in:
CHEVALLIER Abel
2025-11-13 16:23:22 +01:00
parent de9c515a47
commit cb235644dc
34924 changed files with 3811102 additions and 0 deletions

View File

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