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

12 lines
No EOL
582 B
JavaScript

import { concat } from '../observable/concat';
import { take } from './take';
import { ignoreElements } from './ignoreElements';
import { mapTo } from './mapTo';
import { mergeMap } from './mergeMap';
export function delayWhen(delayDurationSelector, subscriptionDelay) {
if (subscriptionDelay) {
return (source) => concat(subscriptionDelay.pipe(take(1), ignoreElements()), source.pipe(delayWhen(delayDurationSelector)));
}
return mergeMap((value, index) => delayDurationSelector(value, index).pipe(take(1), mapTo(value)));
}
//# sourceMappingURL=delayWhen.js.map