Redux Saga async/await pattern

后端 未结 3 1095
伪装坚强ぢ
伪装坚强ぢ 2021-02-01 13:14

I\'m using async/await throughout my codebase. Because of this my api calls are defined by async functions

async function apiFetchFoo {
  return await apiCall(..         


        
3条回答
  •  伪装坚强ぢ
    2021-02-01 13:43

    await always work within a function that's declared as async. #thumbRule

    async function fetchList () {
      let resp = await fetchApi([params]);
    }
    

提交回复
热议问题