async-await

    3熱度

    2回答

    我有一個角部件,其獲取噴射的服務CatalogService: @Injectable() export class CatalogService { get userCatalog(): Observable<MovieResponseItem[]> { return this._userCatalogSubject.asObservable(); } }

    0熱度

    2回答

    比方說,我有以下的(最新)封裝的打字稿項目: [email protected] [email protected] @類型/ Q @ 1.0.5 現在,讓我們在我的項目說我定義它返回一個承諾(以打字稿的原生環境聲明的定義)的函數: import * as q from "q"; function doSomethingElseAsync(): Promise<number> { r

    0熱度

    1回答

    我想知道是否有人可以幫我找出代碼正確使用像 var result = await Task.StartNew(() => ...); 或 var result = await Task<T>.StartNew(() => ...); 從我的理解,這絕不會是有意義的有簡單 await Task.StartNew(() => ...); 或 await Task<T>.StartNew((

    3熱度

    2回答

    我剛開始使用React時,我驚訝地發現,儘可能難以完成最基本的事情。我想要做的就是發出請求並顯示響應。這裏是我的代碼: import React from 'react'; import 'whatwg-fetch'; export default class App extends React.Component { async testBackend() { let

    2熱度

    2回答

    關於:AsyncContextThread https://github.com/StephenCleary/AsyncEx/wiki/AsyncContext https://github.com/StephenCleary/AsyncEx/blob/master/src/Nito.AsyncEx.Context/AsyncContextThread.cs 它真不是蓋的如何處理捕獲當線程開始發生

    3熱度

    1回答

    我試圖將一個變量傳遞給.evaluate,因此我可以在網頁範圍內使用它們,但是我無法獲取它工作。 await nightmare.evaluate(function() { let links = document.querySelectorAll('div.fsl a'); return Array.prototype.map.call(links, function(e

    2熱度

    1回答

    我有下載使用filesaver.js問題端點文件的功能是我需要的函數傳遞到異步等待的方法 fileDownload =() => { fetch('http://localhost:3000/api/buildings/1/assets.xlsx') .then(res => res.blob()) .then(blob => saveAs(blob, 'asse

    3熱度

    1回答

    我有一個C#WPF程序,它打開一個文件,逐行讀取它,操作每一行然後將該行寫入另一個文件。這部分工作正常。我想添加一些進度報告,所以我將這些方法設置爲異步並用於等待進度報告。進度報告非常簡單 - 只需更新屏幕上的標籤即可。這裏是我的代碼: async void Button_Click(object sender, RoutedEventArgs e) { OpenFileDialog

    0熱度

    2回答

    現在我有這個路由控制器 export let remove = (req: Request, res: Response) => { Area.removeAndRecalc(req.query.ids).then(() => { return res.json({ success: true }); }); }; ,並調用下面的模型方法 areaSchema

    -2熱度

    1回答

    是否有可能做使用新的異步/等待下面的函數功能在C#: static void Main(string[] args) { Thread[] thread = new Thread[101]; for (int i = 0; i < 101; i++) { thread[i] = new Thread(IntenseWork); thread