# paging-helper

> utils from paging

Latest version **3.2.0** (published 2021-06-06) · ISC license · 0 weekly downloads

## Install

```sh
npm install paging-helper
pnpm add paging-helper
yarn add paging-helper
bun add paging-helper
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.2.0 |
| Published | 2021-06-06 |
| First published | 2020-12-09 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 26.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | sweet2020 |

## Links

- npm: https://www.npmjs.com/package/paging-helper
- Repository: https://github.com/Sweet-666/paging-helper
- Homepage: https://github.com/Sweet-666/paging-helper#readme
- Issues: https://github.com/Sweet-666/paging-helper/issues
- npm.io page: https://npm.io/package/paging-helper

## Dependencies (2)

- [react](https://npm.io/package/react.md) ^17.0.1
- [@types/react](https://npm.io/package/@types/react.md) ^17.0.3

## Recent versions

- 3.2.0 (latest) — 2021-06-06
- 3.1.5 — 2021-06-06
- 3.1.4 — 2021-06-06
- 3.1.3 — 2021-06-06
- 3.1.2 — 2021-06-05
- 3.1.1 — 2021-06-05
- 3.1.0 — 2021-06-05
- 3.0.11 — 2021-06-05
- 3.0.10 — 2021-06-05
- 3.0.9 — 2021-05-05
- 3.0.8 — 2021-05-05
- 3.0.7 — 2021-05-05
- 3.0.6 — 2021-05-05
- 3.0.5 — 2021-05-05
- 3.0.4 — 2021-05-05
- … 14 more at https://npm.io/package/paging-helper/versions

## README

## Installation
```
  npm install --save paging-helper
```

## Using
```
import { PagingHelper } from 'PagingHelper'

const pageCount = 36
const limit = 10

let data = []
let offset = 0
for (let i = 0; i < pageCount; i++) {
  data.push(i)
}

const PagingHelper = new PagingHelper(limit, offset)

let initData = data.slice(offset, offset + limit)
PagingHelper.setData(initData)

PagingHelper.offset         // 0
PagingHelper.accumulator    // [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
PagingHelper.hasMoreData    // true

PagingHelper.loadMore([11, 12, 13, 14, 15, 16, 17, 18, 19. 20])

PagingHelper.offset         // 1
PagingHelper.accumulator    // [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]
PagingHelper.hasMoreData    // true

```

## Introduce

```
In most case, We have lots of variable with paging. 
It is a util for you to manage your paging.
Just for have a clear mind!
```

## Future
```
PagingHelper is used for mobile.
In the near future, it will support PC
```

---
_Source: https://npm.io/package/paging-helper · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
