Lodash: is it possible to use map with async functions?

后端 未结 4 1194
孤街浪徒
孤街浪徒 2021-02-12 13:10

Consider this code

const response  = await fetch(\'\');
const responseJson = await response.json();
responseJson =  _.sortBy(responseJson, \"number         


        
4条回答
  •  既然无缘
    2021-02-12 13:13

    How about using partial.js(https://github.com/marpple/partial.js)

    It cover both promise and normal pattern by same code.

    _p.map([1, 2, 3], async (v) => await promiseFunction());
    

提交回复
热议问题