About 51 results
Open links in new tab
  1. javascript - How to await an asynchronous function? - Stack Overflow

    Jan 17, 2017 · Await is used to wait for a promise resolving inside of async function. According to a mdn - async function can contain an await expression, that pauses the execution of the async function …

  2. How can I use async/await at the top level? - Stack Overflow

    Use top-level await (proposal, MDN; ES2022, broadly supported in modern environments) that allows top-level use of await in a module. or Use a top-level async function that never rejects (unless you …

  3. javascript - using async await and .then together - Stack Overflow

    Mar 6, 2019 · 31 An async function can contain an await expression that pauses the execution of the async function and waits for the passed Promise's resolution, and then resumes the async function's …

  4. javascript - Async await - does await block other code from running ...

    Dec 28, 2020 · In javascript, does await block code? For example, let's say we have the below code: async function queryDB() { const addUser = await promisePool.execute("INSERT INTO Users …

  5. Como eu posso utilizar o async/await do javascript?

    Jun 8, 2017 · Vi que agora é possível utilizar as keywords async e await no javascript, mas como isso realmente funciona?

  6. javascript - How can I invoke asynchronous code within a constructor ...

    Apr 16, 2017 · At the moment, I'm attempting to use async/await within a class constructor function. This is so that I can get a custom e-mail tag for an Electron project I'm working on. …

  7. When does JavaScript `await` actually wait? - Stack Overflow

    Nov 22, 2016 · When does JavaScript `await` actually wait? Asked 9 years, 2 months ago Modified 9 years, 2 months ago Viewed 4k times

  8. javascript - How to "await" for a callback to return? - Stack Overflow

    When using a simple callback such as in the example below: test () { api.on ( 'someEvent', function ( response ) { return response; }); } How can the function be changed to use async / await?

  9. javascript - Async / await vs then which is the best for performance ...

    Feb 2, 2019 · For those saying await blocks the code until the async call returns you are missing the point. "await" is syntactic sugar for a promise.then (). It is effectively wrapping the rest of your …

  10. How does javascript async/await actually work? - Stack Overflow

    Jul 23, 2019 · An async function can contain an await expression that pauses the execution of the async function Just the async function itself pauses execution, the function that called it goes on then. If …