Keagan Chisnall
1 min readDec 12, 2019

--

My go to pattern is to just make an async function and call it (or use an IIFE if you’re like that):

async function execute() {
let x = await async1(5)
let y = await async2(x)
let z = await async3(y, x)
}
execute()

Advantages include:
1. You don’t need an iterator function (obviously)
2. You can (more easily) use more complex parameters for sub-functions
3. You can feed back multiple async results like in my async3()

Of course, this depends on context, but for this trivial case, I also think it’s more clear as to what is happening.

Having said all that, maybe I missed your point and in the case you are addressing, mine wouldn’t work; so please tell me if this is the case!

--

--

Keagan Chisnall
Keagan Chisnall

Written by Keagan Chisnall

I have a background in process engineering, management, and consulting; but my passion is making systems and processes more efficient. Visit me: chisnall.io

Responses (1)