Questions tagged [ecmascript-2017]

Use this tag for questions about features finalized in ECMAScript 2017. Do *not* use this tag if the code in question merely *uses* one of the features, *unless* the feature is cause of the problem.

Proposals finalized in 2017 include:

387 questions
2
votes
3 answers

async and await and promise in regards to catching errors

I have a question about catching user error in async and wait. Let say I have a route that only fetches for a single user. routes.js routes.get('/getuserbyid/:id', (req, res) => { const id = req.params.id; accountController.getById(id) …
Pak Chu
  • 253
  • 1
  • 5
  • 13
2
votes
1 answer

Async Await es6 optimization

I am trying to use async/await and my code works, I just need advice about is it the right way to use async/await, or do I need .then here. I have a function loadDataForExport - that return promise with generate data. Also, I have actionButtons…
2
votes
1 answer

Why does ESLint throw parsing error while defining async function as method to existing object and how to prevent it?

Let's assume we have plain object const foo = {} and by using Promise constructor syntax we would add async method to it this way: foo.myAsyncMethod = function () { return new Promise((resolve, reject) => { ... }) } but we can't do this…
Kunok
  • 8,089
  • 8
  • 48
  • 89
2
votes
0 answers

Why is an async event handler for a jQuery event not getting called?

I'd like to make use of async/await with fetch in response to my user selecting something from an HTML