3.2.0 • Published 3 years ago

paging-helper v3.2.0

Weekly downloads
10
License
ISC
Repository
github
Last release
3 years ago

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
3.1.3

3 years ago

3.1.2

3 years ago

3.2.0

3 years ago

3.1.1

3 years ago

3.0.10

3 years ago

3.1.0

3 years ago

3.0.11

3 years ago

3.1.5

3 years ago

3.1.4

3 years ago

3.0.4

3 years ago

3.0.3

3 years ago

3.0.8

3 years ago

3.0.7

3 years ago

3.0.6

3 years ago

3.0.5

3 years ago

3.0.9

3 years ago

3.0.2

3 years ago

3.0.1

3 years ago

3.0.0

3 years ago

2.0.9

3 years ago

2.0.8

3 years ago

2.0.7

3 years ago

2.0.6

3 years ago

2.0.5

3 years ago

2.0.3

3 years ago

1.0.2

3 years ago

1.0.3

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago