use-async-memo icon indicating copy to clipboard operation
use-async-memo copied to clipboard

更好的异常处理

Open awmleer opened this issue 6 years ago • 1 comments

awmleer avatar Jun 24 '19 07:06 awmleer

const data = useAsyncMemo(async () => {
  try {
    return await apiService.fetch('/data')
  } catch() {
    return {user: 1}
  }
}, [], null)

awmleer avatar Sep 09 '19 08:09 awmleer