UNPKG

@thi.ng/transducers-async

Version:

Async versions of various highly composable transducers, reducers and iterators

12 lines (11 loc) 260 B
import { compR } from "./compr.js"; import { iterator1 } from "./iterator.js"; function filter(fn, src) { return src ? iterator1(filter(fn), src) : (rfn) => compR( rfn, async (acc, x) => await fn(x) ? rfn[2](acc, x) : acc ); } export { filter };