Skip to content

Commit b624cda

Browse files
committed
fix up docs for selectFromResult
1 parent b781f5c commit b624cda

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

docs/rtk-query/api/created-api/hooks.mdx

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ type UseQueryOptions = {
255255
refetchOnFocus?: boolean
256256
skip?: boolean
257257
refetchOnMountOrArgChange?: boolean | number
258-
selectFromResult?: QueryStateSelector
258+
selectFromResult?: (result: UseQueryStateDefaultResult) => any
259259
}
260260

261261
type UseQueryResult<T> = {
@@ -313,7 +313,7 @@ type UseMutation = (
313313

314314
type UseMutationStateOptions = {
315315
// A method to determine the contents of `UseMutationResult`
316-
selectFromResult?: (state, defaultMutationStateSelector) => SelectedUseMutationResult extends Record<string, any>
316+
selectFromResult?: (result: UseMutationStateDefaultResult) => any
317317
}
318318

319319
type UseMutationTrigger<T> = (
@@ -382,11 +382,7 @@ type UseQueryState = (
382382

383383
type UseQueryStateOptions = {
384384
skip?: boolean
385-
selectFromResult?: (
386-
state,
387-
lastResult,
388-
defaultQueryStateSelector
389-
) => SelectedQueryStateResult
385+
selectFromResult?: (result: UseQueryStateDefaultResult) => any
390386
}
391387

392388
type UseQueryStateResult<T> = {
@@ -481,11 +477,7 @@ type UseLazyQueryOptions = {
481477
pollingInterval?: number
482478
refetchOnReconnect?: boolean
483479
refetchOnFocus?: boolean
484-
selectFromResult?: (
485-
state,
486-
lastResult,
487-
defaultQueryStateSelector
488-
) => UseQueryStateResult
480+
selectFromResult?: (result: UseQueryStateDefaultResult) => any
489481
}
490482

491483
type UseLazyQueryTrigger = (arg: any) => void

0 commit comments

Comments
 (0)