Skip to content

Commit 23622e1

Browse files
committed
fix: beforeFetch type
1 parent 187ebe7 commit 23622e1

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

core/types.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,10 @@ export interface Config<Cond = Record<string, any>, Result = unknown, AfterFetch
3737
pollingWhenOffline?: boolean
3838
revalidateOnFocus?: boolean
3939
cacheProvider?: () => Cache<any>
40-
beforeFetch?: (conditions: Partial<Cond>, cancel: VoidFn) => Promise<Partial<Cond>> | Partial<Cond>
40+
beforeFetch?: (
41+
conditions: Partial<Cond> & Record<string, any>,
42+
cancel: VoidFn
43+
) => Promise<Record<string, any>> | Record<string, any>
4144
afterFetch?: (
4245
data: Result
4346
) => Promise<AfterFetchResult extends Result ? Result : AfterFetchResult> | AfterFetchResult extends Result

test/use-condition-watcher.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ describe('Basic test of vue-condition-watcher', () => {
6565
})
6666
})
6767

68-
it('Reset conditions to custom value and only assign if property exists.', () => {
68+
it('Reset conditions to custom value and only assign if property exists', () => {
6969
const { conditions, resetConditions } = useConditionWatcher(basicTestConfig)
7070

7171
conditions.results = 10

0 commit comments

Comments
 (0)