Hooks
Functions
paginate
This function paginate an array according to page number & size.
Example
import paginate from '@/utils/paginate'
const arr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
const data = paginate(arr, 3, 2)
// output: [4, 5, 6]
Params
| param | Description | Type | Default |
|---|---|---|---|
| array | Array that need to paginate | Array<any> | - |
| pageSize | Maximun element of the output array | number | - |
| pageNumber | Index that start from the array | number | - |
Return
| return | Description | Type | Default |
|---|---|---|---|
| paginatedData | End result | Array<any> | - |