usePaginator
Sourceimport { usePaginator } from "@prestojs/util";
usePaginator(paginatorClassOrProvider,?currentStatePair)
Hook to help manage paginator state. An instance of the specified paginator is created with provided state setter or a default setter if none provided. You only need to provide a state setter if you want to store the state somewhere external eg. from URL query parameters.
Parameter | Type | Description | |
---|---|---|---|
* | paginatorClassOrProvider | PaginatorInterfaceClass|PaginatorClassProvider | |
currentStatePair | [PaginatorState, Function ] | A tuple of current state and a state setter function. If not provided state
is handled internally in usePaginator. You can pass |
Returns
usePaginator(paginatorClassOrProvider,?currentStatePair)
Parameter | Type | Description | |
---|---|---|---|
* | paginatorClassOrProvider | null | |
currentStatePair | [PaginatorState, Function ] |
Returns
usePaginator(paginatorClassOrProvider,?currentStatePair)
Parameter | Type | Description | |
---|---|---|---|
* | paginatorClassOrProvider | PaginatorInterfaceClass|PaginatorClassProvider|null | |
currentStatePair | [PaginatorState, Function ] |
Returns
One of the following:
PaginatorInterfaceOR
null