UNPKG
funcom
Version:
latest (0.2.0)
0.2.0
0.1.0
0.0.0
Functional composition helpers
github.com/nextools/metarepo
nextools/metarepo
funcom
/
node
/
compose-async.js
8 lines
(7 loc)
•
226 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
Object
.
defineProperty
(
exports
,
"__esModule"
, {
value
:
true
});
exports
.
composeAsync
= composeAsync;
function
composeAsync
(
...fns
) {
return
initial
=>
fns.
reduceRight
(
(
arg, fn
) =>
arg.
then
(fn),
Promise
.
resolve
(initial)); }