# firebase-paginator-snapshot

> install package

Latest version **1.0.9** (published 2024-11-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install firebase-paginator-snapshot
pnpm add firebase-paginator-snapshot
yarn add firebase-paginator-snapshot
bun add firebase-paginator-snapshot
```

## Health

**Score 25/100 (F)** — status: maintenance-mode.

Positive: no vulnerabilities.

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

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.9 |
| Published | 2024-11-04 |
| First published | 2020-01-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | diegojimenes_256 |

## Links

- npm: https://www.npmjs.com/package/firebase-paginator-snapshot
- Repository: https://github.com/diegojimenes/firebase-paginator-snapshot
- Homepage: https://github.com/diegojimenes/firebase-paginator-snapshot#readme
- Issues: https://github.com/diegojimenes/firebase-paginator-snapshot/issues
- npm.io page: https://npm.io/package/firebase-paginator-snapshot

## Dependencies (1)

- [lodash](https://npm.io/package/lodash.md) ^4.17.21

## Recent versions

- 1.0.9 (latest) — 2024-11-04
- 1.0.8 — 2024-11-04
- 1.0.7 — 2024-10-29
- 1.0.6 — 2024-04-01
- 1.0.5 — 2020-03-29
- 1.0.4 — 2020-03-29
- 1.0.3 — 2020-01-26
- 1.0.2 — 2020-01-24
- 1.0.1 — 2020-01-24
- 1.0.0 — 2020-01-24

## README

# firebase-paginator-snapshot

install package

```sh
$ npm install firebase-paginator-snapshot
```

### get parameters
List of params

name       | Type    | Description
---------- | ------- | ---------- |
query | Function | Query from firebase
callback | Function | function for received results from firebase query
limit | Number | limit of documents firebase must return
key | String | key to identify your data in the paginator object



```javascript
import paginator from 'firebase-paginator-snapshot'
```

how to use

- create default query

```javascript
import firebase from 'firebase'

const QUERY = () =>
    firebase
    .firestore()
    .collection("list")
    .where("x","==","y")
```

- get first items

```javascript
const limit = 10
const callback = ({data}) => {
  console.log(data)
}

paginator().get(QUERY(), callback, limit, 'key')
```

- get more items

```javascript
const limit = 10
const callback = ({data}) => {
  console.log(data)
}

paginator().get(QUERY(), callback, limit, 'key')
```

- verify end of query

```javascript
paginator().hasEnded()
// return a boolean
```

- shotdown all listeners

```javascript
paginator().offListeners()
```

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