mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-17 14:10:14 +02:00
large performance refactor
This commit is contained in:
@@ -50,9 +50,21 @@ function getInitialData(itemCount: number) {
|
||||
};
|
||||
}
|
||||
|
||||
export const infiniteLoaderDataQueryKey = (
|
||||
serverId: string,
|
||||
itemType: LibraryItem,
|
||||
query?: Record<string, any>,
|
||||
) => {
|
||||
if (query) {
|
||||
return [serverId, 'item-list-infinite-loader', itemType, query];
|
||||
}
|
||||
|
||||
return [serverId, 'item-list-infinite-loader', itemType];
|
||||
};
|
||||
|
||||
export const useItemListInfiniteLoader = ({
|
||||
eventKey,
|
||||
fetchThreshold = 0.2,
|
||||
fetchThreshold = 0.5,
|
||||
itemsPerPage = 100,
|
||||
itemType,
|
||||
listCountQuery,
|
||||
|
||||
Reference in New Issue
Block a user