"await.ops" – less typing, more promise-handling
- Published at
- Updated at
- Reading time
How often do you map over an array to "promisify it" to then use it with
Promise? I do that all the time! It took me until now to realize that using
Promise annoys me.
Promise code by providing methods such as
await. That's exciting!
// before – So! Much! Typing! await Promise.all(users.map(async x => fetchProfile(x.id))) // after – much better! await.all users.map(async x => fetchProfile(x.id))
Let's hope the proposal makes it through the ECMAscript process (it's on stage 1 right now), because