5 ms·
JavaScript function composition: What’s the big deal?
- efortis 4y agoIf you need an async one: pipe(a, b, c) is equivalent to a().then(b).then(c) function pipe(...functions) { (async () => { let accum; for (const fn of functions) accum = await fn(accum); }()); }