-
Recent Posts
Recent Comments
Categories
Links
Daily Archives: August 16, 2018
async常用function整理
concat, concatSeries 連接results in arrayeach, eachSeries 分別執行every, everySeries 分別執行並加上true/false判斷(false即返回)filter, filterSeries 分別執行並加上true/false判斷(只回傳true的coll), 與reject相反map, mapSeries 分別執行並回傳resultsreduce 分別執行並往下傳resultseries 分別執行function, 返回值統一在callback resultswaterfall 分別執行function, 返回值往下傳 實際上大概 mapSeries, waterfall比較常用到,特別像是在一個api裡要執行一連串SQL時。 waterfall則用在SQL根據上一個返回結果動態生成時方便使用 參考: https://caolan.github.io/async/docs.html
Posted in nodejs
Leave a comment