Skip to content

diegojimenes/firebase-paginator-snapshot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

firebase-paginator-snapshot

install package

$ 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
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()

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published