UNPKG

@thi.ng/transducers-async

Version:

Async versions of various highly composable transducers, reducers and iterators

18 lines (17 loc) 353 B
import { NO_OP } from "@thi.ng/api/api"; import { transduce } from "./transduce.js"; async function run(tx, ...args) { if (args.length === 1) { await transduce(tx, [NO_OP, NO_OP, NO_OP], args[0]); } else { const fx = args[0]; await transduce( tx, [NO_OP, NO_OP, (_, x) => fx(x)], args[1] ); } } export { run };