diff options
author | Alex Early <alexander.early@gmail.com> | 2018-09-30 17:00:10 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-30 17:00:10 -0700 |
commit | 8aecf108b3922bc5211036706a0f6f75e02bd42b (patch) | |
tree | 0f7b6bee315231ef4aefdfbee154822921de231f /lib/compose.js | |
parent | df41256f49c9bb3126e035c95aca7860329b6acf (diff) | |
download | async-8aecf108b3922bc5211036706a0f6f75e02bd42b.tar.gz |
feat: await-able Async methods (#1572)
* make each and family awaitable
* dont pretend they're AsyncFunctions
* check errors
* ensure function name is preserved somehow
* awaitable concat
* awaitable detect
* awaitable every/filter
* awaitable groupBy
* awaitable map/mapValues
* awaitable reduce
* awaitable reject
* awaitable some
* awaitable transform
* awaitable times
* awaitable auto
* awaitable compose/seq
* awaitable whilst/until (lol)
* awaitable forever
* awaitable parallel/race
* awaitable retry
* awaitable series (lol)
* awaitable tryEach
* awaitable waterfall (lol)
* lint
* cleanup, remove noop and unused internal functions
Diffstat (limited to 'lib/compose.js')
-rw-r--r-- | lib/compose.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/compose.js b/lib/compose.js index 1706013..ea97c43 100644 --- a/lib/compose.js +++ b/lib/compose.js @@ -6,6 +6,9 @@ import seq from './seq'; * follows. Composing functions `f()`, `g()`, and `h()` would produce the result * of `f(g(h()))`, only this version uses callbacks to obtain the return values. * + * If the last argument to the composed function is not a function, a promise + * is returned when you call it. + * * Each function is executed with the `this` binding of the composed function. * * @name compose @@ -35,6 +38,6 @@ import seq from './seq'; * // result now equals 15 * }); */ -export default function(...args) { +export default function compose(...args) { return seq(...args.reverse()); } |