1.0.6 • Published 1 month ago

firebase-paginator-snapshot v1.0.6

Weekly downloads
2
License
MIT
Repository
github
Last release
1 month ago

firebase-paginator-snapshot

install package

$ npm install firebase-paginator-snapshot

get parameters

List of params

nameTypeDescription
queryFunctionQuery from firebase
callbackFunctionfunction for received results from firebase query
limitNumberlimit of documents firebase must return
keyStringkey to identify your data in the paginator object
import paginator from 'firebase-paginator-snapshot'

how to use

  • create default query
import firebase from 'firebase'

const QUERY = () =>
    firebase
    .firestore()
    .collection("list")
    .where("x","==","y")
  • get first items
const limit = 10
const callback = ({data}) => {
  console.log(data)
}

paginator().get(QUERY(), callback, limit, 'key')
  • get more items
const limit = 10
const callback = ({data}) => {
  console.log(data)
}

paginator().get(QUERY(), callback, limit, 'key')
  • verify end of query
paginator().hasEnded()
// return a boolean
  • shotdown all listeners
paginator().offListeners()
1.0.6

1 month ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago