<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                async 內部是一個迭代器函數,await就像里面的 yield,每次都會執行await后面的函數,并且進行next操作,然后將返回值作為next的參數 ```js function async(generator) { let iterator = generator(); // 獲取迭代器 function handle(iteratorResult) { if (iteratorResult.done) return; // 如果迭代結束 const interatorValue = iteratorResult.value; // axios 的返回值 promise console.log(interatorValue, 11); // 如果是個 promise if (interatorValue instanceof Promise) { interatorValue .then((res) => { // res里是Promise.then的數據 handle(iterator.next(res)); // 已經獲取到第一次請求的值了,進行的是下一次的迭代 }) .catch((err) => { iterator.throw(err); // 拋出錯誤 }); } } try { handle(iterator.next()); // 傳入 {value: '', done: false} } catch (err) { iterator.throw(err); // 拋出錯誤 } } async(function* () { try { let res1 = yield axios.get("http://localhost:666"); console.log("res1", res1); let res2 = yield axios.get("http://localhost:666"); console.log("res2", res2); let res3 = yield axios.get("http://localhost:666"); console.log("res3", res3); } catch (err) { console.log("has some error"); } }); ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看