feat: use function hooks instead of class hooks
This commit is contained in:
@@ -110,6 +110,7 @@ class QueryClient {
|
||||
)
|
||||
.cast<DataType, ErrorType, PageType>();
|
||||
query.updateQueryFn(queryFn);
|
||||
query.updateNextPageFn(nextPage);
|
||||
cache.addInfiniteQuery(query);
|
||||
return query;
|
||||
}
|
||||
|
||||
@@ -314,6 +314,7 @@ class InfiniteQuery<DataType, ErrorType, PageType>
|
||||
}
|
||||
|
||||
void updateNextPageFn(InfiniteQueryNextPage<DataType, PageType> nextPage) {
|
||||
if (state._nextPage == nextPage) return;
|
||||
state = state.copyWith(nextPage: nextPage);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user