timing-provider
Version:
An implementation of the timing provider specification.
6 lines • 544 B
JavaScript
import { EMPTY, concat, dematerialize, filter, ignoreElements, materialize, of, startWith, switchMap, takeWhile, tap } from 'rxjs';
import { isNotNullish } from 'rxjs-etc';
export const echo = (callback, predicate, timer) => (source) => source.pipe(materialize(), startWith(null), switchMap((notification) => concat(of(notification), notification === null || notification.kind === 'N'
? timer.pipe(takeWhile(predicate), tap(callback), ignoreElements())
: EMPTY)), filter(isNotNullish), dematerialize());
//# sourceMappingURL=echo.js.map