@ppcano wrote:
The first time, I saw
async
andawait
in Ember was on the New Testing API RFC, but last day, I read thatasync/await
can also be used in your application code. @rwjblue wrote about it in a very informative post: An async / await Configuration Adventure.There are two possible scenarios to use
async/await
in your application code:
If you support only browsers with native support, edit your
config/targets
.For supporting older browsers, you may also want to edit your
config/targets
, installember-maybe-import-regenerator
and unsetbabel.includePolyfill
.I recommend reading the whole post, it provides a very good explanation about all the different scenarios and gotchas.
async/await
can produce a more concise and clean code in many cases. I have gotten too used to writing Promise chains that it was not obvious that I could start usingasync/await
in my application code.If you can afford to include the ember-maybe-import-regenerator addon that adds the
2kb gzipped
dependency, just try them out!
Posts: 1
Participants: 1