create-nova-vite-template
Version:
This is a dashboard template built with React and Vite. It provides a modern and responsive user interface for building web applications.
18 lines (15 loc) • 459 B
text/typescript
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable consistent-return */
/* eslint-disable no-param-reassign */
const infintyPaginationMergeHandler = (currentCache: any, newItems: any) => {
if (!newItems?.previous) {
return {
...newItems,
};
}
if (currentCache?.next) {
currentCache.next = newItems?.next;
currentCache.results.push(...newItems.results);
}
};
export default infintyPaginationMergeHandler;