hugoWebsite/node_modules/rxjs/dist/esm/internal/operators/switchScan.js
Jeremy Nusser 0ab675d92b Initial commit... 🎉🎉🎉
2022-10-28 17:20:35 -05:00

12 lines
No EOL
464 B
JavaScript

import { switchMap } from './switchMap';
import { operate } from '../util/lift';
export function switchScan(accumulator, seed) {
return operate((source, subscriber) => {
let state = seed;
switchMap((value, index) => accumulator(state, value, index), (_, innerValue) => ((state = innerValue), innerValue))(source).subscribe(subscriber);
return () => {
state = null;
};
});
}
//# sourceMappingURL=switchScan.js.map