Skip to content

Commit a24d5d9

Browse files
authored
feat: add isFetchingNextPage to transformReactQueryResponse and CommonServiceType (#53)
1 parent b071a53 commit a24d5d9

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

packages/gene/src/react-query/transformReactQueryResponse.ts

+4
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ export function transformReactQueryResponse<TData = null, TVariables = null>(
4242

4343
const hasMore = 'hasNextPage' in response ? response.hasNextPage : undefined;
4444

45+
const isFetchingNextPage =
46+
'isFetchingNextPage' in response ? response.isFetchingNextPage : undefined;
47+
4548
return {
4649
error: response.error || null,
4750
data: response.data,
@@ -50,5 +53,6 @@ export function transformReactQueryResponse<TData = null, TVariables = null>(
5053
fetchPreviousPage,
5154
hasMore,
5255
refetch,
56+
isFetchingNextPage,
5357
};
5458
}

packages/gene/src/services/types.ts

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export interface CommonServiceType<
1212
fetchMore?: TFetchMore;
1313
fetchPreviousPage?: TFetchPreviousPage;
1414
hasMore?: boolean;
15+
isFetchingNextPage?: boolean;
1516
}
1617

1718
export interface FetchPropsType<TData, TVariables, TQueryKey> {

0 commit comments

Comments
 (0)