We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ff1ac2e commit 49ab5e7Copy full SHA for 49ab5e7
src/useAsync.js
@@ -81,12 +81,9 @@ const useAsync = (arg1, arg2) => {
81
useEffect(() => {
82
if (watchFn && prevOptions.current && watchFn(options, prevOptions.current)) load()
83
})
84
- useEffect(
85
- () => {
86
- promise || promiseFn ? load() : cancel()
87
- },
88
- [promise, promiseFn, watch]
89
- )
+ useEffect(() => {
+ promise || promiseFn ? load() : cancel()
+ }, [promise, promiseFn, watch])
90
useEffect(() => () => (isMounted.current = false), [])
91
useEffect(() => () => abortController.current.abort(), [])
92
useEffect(() => (prevOptions.current = options) && undefined)
0 commit comments