精华内容
下载资源
问答
  • Use await to get contacts

    2020-11-27 20:28:09
    t figure out a good way to use await with Contacts.getAll. I want to be able to do something similar to what React Native uses for AsyncStorage ...
  • Add async/await to V8

    2020-12-05 08:36:02
    - Add Async/await for 2 or 3 points (latter would match promises)...perhaps split between detecting async functions and the await keyword, but they go together. <p>Spec: ...
  • <div><p>This is a placeholder ticket and a new place to ...<p>The upcoming EcmaScript <a href="https://tc39.github.io/ecmascript-asyncawait/">Async Await</a> may finally make it possible to support ...
  • <div><p>The body of <code>Templates</code>\ <code>HelperResult</code> is synchronous which disallows calling await inside of it. We need to start generating async lambdas for these types. In addition,...
  • <div><p>This PR adds another feature to the iodide api - <code>iodide.evalQueue.await</code>. Motivated by the discussion in #597, we want an easy way to prevent further cell evaluation until certain ...
  • <div><h1>301</h1><p>该提问来源于开源项目:AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet</p></div>
  • s async await library <p>CompletableFuture - https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/CompletableFuture.html EA Async Await library for Java - ...
  • ve moved away all the model / automatic pagination stuff, because it was pretty heavy on the async/await lifestyle. I'll revisit this after we address API changes. <p>Todo after this: - Get docs ...
  • <div><p>Accessing the results in a blocking way causes problems</p><p>该提问来源于开源项目:jamesmanning/RunProcessAsTask</p></div>
  • <div><p>https://tachyon.atlassian.net/browse/TACHYON-1265</p><p>该提问来源于开源项目:Alluxio/alluxio</p></div>
  • <div><p>This will make the code much cleaner and should also improve performance.</p><p>该提问来源于开源项目:rafaelgomesxyz/esgst</p></div>
  • <div><p>This is an automated cherry-pick of #4474 <p>/assign sahil143</p><p>该提问来源于开源项目:openshift/console</p></div>
  • import to from 'await-to-js' ; // If you use CommonJS (i.e NodeJS environment), it should be: // const to = require('await-to-js').default; async function asyncTaskWithCb ( cb ) { let err , user , ...
  • Replace all .ContinueWith to use async await. <p><strong>Describe alternatives you've considered The only alternative is to continue to use ContinueWIth. This will require additional refactoring ...
  • <p>Does anyone know how I can get async/await to work in a glimmer app? (Or alternatively how to get jquery. Can I say that without being lynched?) <p>The "project" i'm working on is ...
  • Can we just return promises and users can use the modern async/await to get the information required? <p>I'm being stumbled upon where I've to stream the preview results whenever it is ...
  • Moving to async await

    2020-12-09 14:45:32
    <p>The disadvantage of modifying the api in this way is that it can be harder to use the api: previously you were able to just create a bunch of requests and await them all. Now you must create the ...
  • Rewrite function to await

    2020-11-30 01:15:09
    <p>I would like to wait for the result C# <pre><code> var titles = await GetTitles(); ///.... function async GetTitles() { ///.... } </code></pre>该提问来源于开源项目:yortus/asyncawait</p>...
  • <div><p>Would it be possible for you ...<p>It generates a warning if we just want to try await a function whose return value we do not care about.</p><p>该提问来源于开源项目:freshOS/Then</p></div>
  • Transition to async/await

    2020-12-01 20:11:39
    - Transition to async/await (requires replacement of BlueBird, <strong>DONE) - extend CloudFormation template with failure notification (DONE) - add tests, I chose the Jest library for now (DONE) - ...
  • Basically I am looking to get the ES7 await style functionality - ie <p>function myFoo(id) { var x = await SomeAsyncFunction() return x; } <p>is this possible ?</p><p>该提问来源于开源项目:...
  • await

    万次阅读 2019-11-13 15:55:40
    await 操作符用于等待一个Promise 对象。...(The await operator is used to wait for a Promise. It can only be used inside an async function.) 语法 [return_value] = await expression; 参数: exp...

    await 操作符用于等待一个Promise 对象。它只能在异步函数 async function 中使用。(The await operator is used to wait for a Promise. It can only be used inside an async function.)

    语法

    [return_value] = await expression;
    

    参数

    • expression:一个 Promise 对象或者任何要等待的值。
    • return_value: 返回 Promise 对象的处理结果。如果等待的不是 Promise 对象,则返回该值本身。

    await 表达式会暂停当前 async function 的执行,等待 Promise 处理完成。若 Promise 正常处理(fulfilled),其回调的resolve函数参数 作为 await 表达式的值,接着继续执行 async function。若 Promise 处理异常(rejected),await 表达式会把 Promise 的异常原因抛出。另外,如果 await 操作符后的表达式的值不是一个 Promise,await 会把该值转换为已正常处理的Promise并等待结果返回。(If the value of the expression following the await operator is not a Promise, it’s converted to a resolved Promise.)

    举例一:如果一个 Promise 被传递给一个 await 操作符,await 将等待 Promise 正常处理完成并返回其处理结果

    function resolveAfter2Seconds(x) {
        return new Promise(resolve => {
            setTimeout(() => {
                resolve(x);
            }, 2000);
        })
    }
    
    async function f1() {
        let x = await resolveAfter2Seconds('happy chen');
        console.log(x);
    }
    
    f1();
    console.log(f1());
    console.log(f1);
    //立即输出
    // Promise { <pending> }
    // [AsyncFunction: f1]
    //2s后输出
    // happy chen
    // happy chen
    

    举例二:如果该值不是一个 Promise,await 会把该值转换为已正常处理的Promise并等待结果返回

    async function f1(){
        let x = await 'happy chen';
        console.log(x);
    }
    
    f1();
    console.log(f1());
    console.log(f1);
    
    // Promise { <pending> }
    // [AsyncFunction: f1]
    // happy chen
    // happy chen
    

    举例三:如果 Promise 处理异常,则异常值被抛出

    async function f1() {
        try {
            let x = await Promise.reject('something wrong');
        } catch (e) {
            console.log(e);
        }
    }
    
    f1();
    console.log(f1());
    console.log(f1);
    // Promise { <pending> }
    // [AsyncFunction: f1]
    // something wrong
    // something wrong
    
    展开全文
  • </li><li>This rename old tokio/future import to tokio01/future01.<ul><li>This change aim to begin to use async/.await compatible code.</li></ul> </li></ul> <h2>Related Issues <ul><li>...
  • <div><p>I tried to use the <code>should</code> module with ES6 async/await code, and it was only partly successful, in the sense that it did not fail, but the functions were executed at the end of the...
  • Port to Async/Await

    2020-12-09 00:27:33
    <div><p>as I have already mentioned in <a href="https://github.com/stepancheg/grpc-rust/issues/164">grpc-rust#164</a> I am wondering if it would be in the plan to port this repo to new async/await ...
  • <p>So this task tracks investigation and work needed to polyfill <code>async</code>/<code>await</code>. Some initial questions: 1. Do we want to wait for ES8 (ES2017) to (maybe) include it, and for ...
  • AWAIT

    2020-12-05 21:38:33
    <div><p>Hey guys, sorry, I'm new to NodeJS. Is there any way to await for a post call??</p><p>该提问来源于开源项目:criso/fbgraph</p></div>
  • Update to async/await

    2021-01-09 00:15:51
    <div><p>This updates reqwest from futures 0.1 to <code>std::future::Future, and uses <code>async</code>/<code>await</code> syntax. This is a rebase and update of ...
  • await asyncWrap(promiseFn()) if (err) reponse to err <p>-- note that due to an issue with react hot loader babel plugin, I left the containers with normal promises, although there are not very many ...
  • <p>Removes the <code>ForAwaitStatement</code> node type and adds an <code>await</code> flag to the existing <code>ForOfStatement</code> node!</p><p>该提问来源于开源项目:babel/babylon</p></div>

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 24,319
精华内容 9,727
关键字:

awaitto