Skip to content

Commit eed7092

Browse files
committed
docs: fix use-request auto collect deps context
1 parent 52f7a08 commit eed7092

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

packages/hooks/src/useRequest/plugins/useAutoRunPlugin.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ const useAutoRunPlugin: UseRequestPlugin<unknown, unknown[]> = (
99
const hasAutoRun = ref(false)
1010

1111
watchEffect(() => {
12-
if (!manual && fetchInstance.options.refreshDeps !== true) hasAutoRun.value = unref(ready)
12+
if (!manual && fetchInstance.options.refreshDeps !== true) {
13+
hasAutoRun.value = unref(ready)
14+
}
1315
})
1416

1517
if (refreshDeps instanceof Array)

packages/hooks/src/useRequest/useRequestImplement.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ function useRequestImplement<TData, TParams extends any[]>(
9393

9494
// manual
9595
onMounted(() => {
96-
if (!manual) {
96+
if (!manual && fetchInstance.options.refreshDeps !== true) {
9797
const params = fetchInstance.state.params || options.defaultParams || []
9898
if (unref(ready)) fetchInstance.run(...(params as TParams))
9999
}

0 commit comments

Comments
 (0)