question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ES7 Async/Await question

See original GitHub issue

Not sure if this is the right place to ask this question, and if it is not, then feel free to close the issue 😃

Doing some research into ES7 async/await, I came across this article: https://spion.github.io/posts/es7-async-await-step-in-the-wrong-direction.html

Refering to the section, ‘Loss of generality and power’, I was wondering, is the argument in that article relevant to koa@2.0.0? It does seem that generators, as used in koa@1.2.0 are much stronger than async functions, although the async/await pattern does seem to satisfy most use cases

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

3reactions
jonathanongcommented, Mar 18, 2016

i’m not sure what the article is saying (i only skimmed it). you could always do something like:

app.use(Bluebird.coroutine(function * (ctx, next) {
  yield next()
})

and replace Bluebird.coroutine() with whatever engine you want.

1reaction
PlasmaPowercommented, Mar 17, 2016

You can extend the Application class to override callback and use.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Javascript Async/Await: Javascript Interview questions #10
What is the async / await and how can we use asynchronous functions in javascript and await for them? Hello everyone, in this...
Read more >
Getting to Know Promises, Async, and Await in JS
Await is another keyword that is used in conjunction with async. Like the literal meaning of await, this keyword allows us to suspend...
Read more >
Async Await JavaScript ES7 - YouTube
JavaScript Async Await explained. Practical application of Async Await and Error handling with try catch. *code samplesAsync Await Example ...
Read more >
async function - JavaScript - MDN Web Docs - Mozilla
The async function declaration declares an async function where the await keyword is permitted within the function body. The async and await ......
Read more >
Order in Promise/Async/Await (Interview Question)
Asynchronous operations such as reading data from a file or fetching an http response from an external server all take an indeterminate and ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found