-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(react-query): update to major v5 #13
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
import {useMemo} from 'react'; | ||
|
||
import {useInfiniteQuery} from '@tanstack/react-query'; | ||
|
||
import type {DataSourceContext, DataSourceOptions, DataSourceParams} from '../../../core'; | ||
import type { | ||
DataSourceContext, | ||
DataSourceOptions, | ||
DataSourceParams, | ||
DataSourceState, | ||
} from '../../../core'; | ||
|
||
import type {AnyInfiniteQueryDataSource} from './types'; | ||
import {composeOptions, transformResult} from './utils'; | ||
|
@@ -11,10 +14,10 @@ export const useInfiniteQueryData = <TDataSource extends AnyInfiniteQueryDataSou | |
context: DataSourceContext<TDataSource>, | ||
dataSource: TDataSource, | ||
params: DataSourceParams<TDataSource>, | ||
options?: DataSourceOptions<TDataSource>, | ||
) => { | ||
options?: Partial<DataSourceOptions<TDataSource>>, | ||
): DataSourceState<TDataSource> => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you move partial type to DataSourceOptions? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe that having origin options can be useful |
||
const composedOptions = composeOptions(context, dataSource, params, options); | ||
const result = useInfiniteQuery(composedOptions); | ||
|
||
return useMemo(() => transformResult(result), [result]); | ||
return transformResult(result); | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you need todo?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, just a reminder to find another function for hashing in the future