9 ms·
You can make it yourself fairly easily I guess: const awaitAll = Promise.all.bind(Promise); async function foo() { var [val1, val2] = await aw
by steve_adams_86 9y ago
You can make it yourself fairly easily I guess:
const awaitAll = Promise.all.bind(Promise);
async function foo() {
var [val1, val2] = await awaitAll([func1, func1]);
}
It isn't ideal but it's a little cleaner
- nailer 9y ago+1. I'm a big fan of top level function binds to remove boilerplate and keep code readable: const log = console.log.bind(console), query = document.querySelector.bind(document), queryAll = document.querySelectorAll.bind(document);
- RReverser 9y agoYou don't need to bind `console.log` by the way (at least not in any recent version of Node.js or browsers).
- ujal 9y agoawait all([fn1, fn2]) ;) i wonder when we will get s-expressions for function calls (awaitAll [fn1, fn2])
- doublerebel 9y agoJust write (iced) coffeescript, s-exp are totally valid there: https://github.com/nextorigin/riemann-query-parser/blob/master/src/riemann-query.coffee https://github.com/nextorigin/riemann-query-parser/blob/mast...
- ujal 9y agoYeah, s-exps are the only thing I miss :(