What are benefits of ES7 Async Await over Meteor.wrapAsync?

As a title!

Many threads introduce the use of ES7 Async Await. What are benefits of ES7 Async Await over Meteor.wrapAsync?

The main benefit for me is to make the code which runs on the server consistent with the client. Both server and client can be transpiled from async/await, where Fibers (Meteor.wrapAsync) only work on the server. This means you have write your code (particularly method and publication code) differently for server and client when they must handle async operations.

Better to have one way to do it that works on both server and client, and to me async/await is it.

1 Like

I’ll add ecosystem adoption: there’s much more traction behind promises than fibers/futures.

1 Like

Aren’t async/await compiled to meteor promises which use fibers on the server?

  • async/await will be a part of the next EcmaScript standard.
  • It is connected with the Promise primitive, which is already part of ES2015.
  • The async/await syntax is quiet simple and powerful.
  • async/await can be implemented with generators which is supported in modern browsers, not just on the server side with node.js.
1 Like

I have read the same - that async/await gets compiled to meteor promises/fibers on the server, but it’s hard to find concrete examples of how to do this.