1 | import { QueryResult } from 'react-apollo';
|
2 | import { DocumentNode } from 'graphql';
|
3 | import { Route } from '../types';
|
4 | interface QueryVariables {
|
5 | offset: number;
|
6 | first: number;
|
7 | }
|
8 | declare const useInfinitePagination: ({ result, query }: {
|
9 | result: QueryResult<{
|
10 | route: Route;
|
11 | }, QueryVariables>;
|
12 | query: DocumentNode;
|
13 | }) => {
|
14 | previous: {
|
15 | loadingProducts: boolean;
|
16 | hasProducts: boolean;
|
17 | fetchProducts: () => void;
|
18 | offset: number;
|
19 | page: number;
|
20 | };
|
21 | next: {
|
22 | loadingProducts: boolean;
|
23 | hasProducts: boolean;
|
24 | fetchProducts: () => void;
|
25 | offset: number;
|
26 | page: number;
|
27 | };
|
28 | products: any[];
|
29 | };
|
30 | export default useInfinitePagination;
|