🐛 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 { try {
setIsLoading(true) setIsLoading(true)
const value = await fn(args) const value = await fn(args)
setIsLoading(false)
setError(null) setError(null)
setValue(value) setValue(value)
} catch (error) { } catch (error) {
setIsLoading(false) setIsLoading(false)
setValue(null)
setError(error) setError(error)
setValue(null)
} }
} }