Software Consultant & Developer at Atomic Object Grand Rapids. Loves a good refactor.
`includePolyfill: true` ends up adding 30kb (gzipped, minified) to the production build. For some apps this is okay.
But if you want to keep your application payload slimmer, there are two more ways you can get this working:
In test code, async/await works perfectly for me :)
However, with application code there are still some issues with `Ember.run`. RSVP Promises include an Ember.run implicitly, but await code would need Ember.run to be explicit wherever it’s relevant. This RFC explains the situation:
For now, my team and I aren’t going to use async/await in our application code.
I used the https://github.com/machty/ember-maybe-import-regenerator way, suggested by Casey Watts in one of those links above. It worked ok.
However, I am disappointed to find out that you can’t declare an observer function as async. It won’t work. At least it did not work for me. It works when I declare class methods async though.
Comments are closed.
We’d love to talk with you about your next great software project. Fill out this form and we’ll get back to you within two business days.