Skip to content
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

[frontend] upgrade to react-query v5 #14346

Merged
merged 24 commits into from
Oct 24, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
support select
  • Loading branch information
williamrobertson13 committed Oct 23, 2023
commit df6d37f5fc1fc70dca8ab26af48f4713c50d72b4
18 changes: 14 additions & 4 deletions sdk/dapp-kit/src/hooks/useSuiClientInfiniteQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,15 @@ export type SuiRpcPaginatedMethods = {
: never;
};

export type UseSuiClientInfiniteQueryOptions<T extends keyof SuiRpcPaginatedMethods> = PartialBy<
export type UseSuiClientInfiniteQueryOptions<
T extends keyof SuiRpcPaginatedMethods,
TData,
> = PartialBy<
Omit<
UseInfiniteQueryOptions<
SuiRpcPaginatedMethods[T]['result'],
Error,
SuiRpcPaginatedMethods[T]['result'],
TData,
SuiRpcPaginatedMethods[T]['result'],
unknown[]
>,
Expand All @@ -51,10 +54,17 @@ export type UseSuiClientInfiniteQueryOptions<T extends keyof SuiRpcPaginatedMeth
'queryKey'
>;

export function useSuiClientInfiniteQuery<T extends keyof SuiRpcPaginatedMethods>(
export function useSuiClientInfiniteQuery<
T extends keyof SuiRpcPaginatedMethods,
TData = SuiRpcPaginatedMethods[T]['result'],
>(
method: T,
params: SuiRpcPaginatedMethods[T]['params'],
{ queryKey = [], enabled = !!params, ...options }: UseSuiClientInfiniteQueryOptions<T> = {},
{
queryKey = [],
enabled = !!params,
...options
}: UseSuiClientInfiniteQueryOptions<T, TData> = {},
) {
const suiContext = useSuiClientContext();

Expand Down