UNPKG

caminho

Version:

Tool for creating efficient data pipelines in a JavaScript environment

23 lines 830 B
import { filter as filterRxJs } from 'rxjs'; export function filter(predicate, loggers, pendingDataControl) { function wrappedFilter(valueBag, index, runId) { const startedAt = new Date(); loggers.onStepStarted([valueBag]); try { const filterResult = predicate(valueBag, index); if (!filterResult) { pendingDataControl?.decrement(runId); } loggers.onStepFinished([valueBag], startedAt); return filterResult; } catch (err) { loggers.onStepFinished([valueBag], startedAt, err); throw err; } } return function filterOperatorWithRunId(runId) { return filterRxJs((valueBag, index) => wrappedFilter(valueBag, index, runId)); }; } //# sourceMappingURL=filter.js.map