🐛 FIX:
This commit is contained in:
@ -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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user