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.
useAsync(promiseFn, initialValue)
1 parent 5e1ad23 commit 3ace5f9Copy full SHA for 3ace5f9
src/useAsync.js
@@ -7,6 +7,9 @@ const useAsync = (opts, init) => {
7
const prevOptions = useRef(undefined)
8
const abortController = useRef({ abort: () => {} })
9
10
+ if (typeof opts === "function" && init) {
11
+ console.warn("`useAsync(promiseFn, initialValue)` is deprecated and will be removed soon.")
12
+ }
13
const options = typeof opts === "function" ? { promiseFn: opts, initialValue: init } : opts
14
const { promiseFn, deferFn, initialValue, onResolve, onReject, watch, watchFn } = options
15
0 commit comments