tooot/src/utils/queryHooks/utils.ts

9 lines
332 B
TypeScript
Raw Normal View History

2022-12-10 20:19:18 +01:00
import { InstanceResponse } from '@api/instance'
export const infinitePageParams = {
getPreviousPageParam: (firstPage: InstanceResponse<any>) =>
firstPage.links?.prev && { since_id: firstPage.links.next },
getNextPageParam: (lastPage: InstanceResponse<any>) =>
lastPage.links?.next && { max_id: lastPage.links.next }
}