caminho
Version:
Tool for creating efficient data pipelines in a JavaScript environment
23 lines • 915 B
JavaScript
import { filter as filterRxJs } from 'rxjs';
export function filter(predicate, loggers, pendingDataControl) {
function wrappedFilter(valueBag, index, runId) {
var startedAt = new Date();
loggers.onStepStarted([valueBag]);
try {
var filterResult = predicate(valueBag, index);
if (!filterResult) {
pendingDataControl === null || pendingDataControl === void 0 ? void 0 : pendingDataControl.decrement(runId);
}
loggers.onStepFinished([valueBag], startedAt);
return filterResult;
}
catch (err) {
loggers.onStepFinished([valueBag], startedAt, err);
throw err;
}
}
return function filterOperatorWithRunId(runId) {
return filterRxJs(function (valueBag, index) { return wrappedFilter(valueBag, index, runId); });
};
}
//# sourceMappingURL=filter.js.map