https://github.com/cromarmot/pagination
1 2 4 8 16 instead of 1 2 3 4 5
https://github.com/cromarmot/pagination
node pagination
Last synced: 2 months ago
JSON representation
1 2 4 8 16 instead of 1 2 3 4 5
- Host: GitHub
- URL: https://github.com/cromarmot/pagination
- Owner: CroMarmot
- License: mit
- Created: 2020-08-21T07:42:44.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-08-08T07:07:03.000Z (almost 2 years ago)
- Last Synced: 2025-03-01T20:17:08.593Z (3 months ago)
- Topics: node, pagination
- Language: TypeScript
- Homepage:
- Size: 84 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pagination
Stop using pagination 1 2 3 4 5 6...
use pagination 1 2 4 8 16... right now !
# Online Demo
https://jvgcv.csb.app/
https://codesandbox.io/s/paginationdemo-jvgcv?file=/src/App.vue
## Install
`yarn add @cromarmot/pagination`
## Usage
```js
import {Pagination} from '@cromarmot/pagination';
const pm = new Pagination();console.log(pm.setRange(1, 1000, 1));
console.log(pm.setRangeCurrent(50));
console.log(pm.setArray(['hey','hello','what','hi','test'],0));
console.log(pm.setArrayIndex(4));
```## APIs
`current()`
`setRange(rangeStartInteger,rangeEndInteger,rangeCurrentInteger)`
`setRangeCurrent(rangeCurrentInteger)`
`setArray(any[],index)`
`setArrayIndex(index)`
## Test
`yarn test`
# Examples
https://atcoder.jp/ranking