🐛 FIX:

This commit is contained in:
sagar
2020-01-09 20:26:38 +05:30
parent ea39369af7
commit ea559a1e66

View File

@ -23,12 +23,13 @@ const useAsync = (fn, options = {}) => {
try {
setIsLoading(true)
const value = await fn(args)
setIsLoading(false)
setError(null)
setValue(value)
} catch (error) {
setIsLoading(false)
setValue(null)
setError(error)
setValue(null)
}
}