3 ms·
You can also use a transpiler such as 6to5[0] which supports ES7 async/await. [0]: http://6to5.org/ http://6to5.org/
by aeosynth 12y ago
You can also use a transpiler such as 6to5[0] which supports ES7 async/await.
[0]: http://6to5.org/ http://6to5.org/
- drapper 12y ago...and you can also have something like that using Bluebird.coroutine() (https://github.com/petkaantonov/bluebird/blob/master/API.md#... https://github.com/petkaantonov/bluebird/blob/master/API.md#...) or co (https://github.com/tj/co https://github.com/tj/co, see also https://github.com/koajs/koa https://github.com/koajs/koa)
- phpnode 12y ago6to5 actually supports compiling async/await to bluebird coroutines
- soaringmonchi 12y agoDefinitely my preferred approach. Note that you need to run 6to5 with the -e flag to try this.
- thejameskyle 12y agoI think you mean the --experimental flag. -e is for evaluate.
- jonpaul 12y agoWhere does it say that it supports async/await?
- drapper 12y agohttp://6to5.org/docs/usage/transformers/#async-to-generator http://6to5.org/docs/usage/transformers/#async-to-generator
- davedx 12y agoWhaaa... they're putting experimental ES7 features in a transpiler called 6to5? Or am I missing something?