A library to help you use await
, less.
In a world full of prefix awaits (ever heard of postfix await?), constantly having to wrap your expressions with parenthesis gets tedious. What if you could defer using await?
That's where Await Less' SmartPromise
comes in. You can wrap any old promise with it, and then use it as if it was the finished value. Most actions performed on a SmartPromise
will be automatically deferred and performed on the underlying value, once the promise completes.
await (await (await (await something()).getThat. doThat()).doThis()).getThat.doOther();
await Smart(something()).getThat.doThat().doThis().getThat.doOther();