Skip to content

Commit 6fff343

Browse files
committed
refactor: simplify functionalUpdate by using resolveOption
1 parent d6ea2f1 commit 6fff343

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

packages/query-core/src/utils.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,7 @@ export function functionalUpdate<TInput, TOutput>(
169169
updater: Updater<TInput, TOutput>,
170170
input: TInput,
171171
): TOutput {
172-
return typeof updater === 'function'
173-
? (updater as (_: TInput) => TOutput)(input)
174-
: updater
172+
return resolveOption(updater, input)
175173
}
176174

177175
export function isValidTimeout(value: unknown): value is number {

0 commit comments

Comments
 (0)