Firestore Sweet

Firestore Sweet

  • Tutorial
  • API
  • Github

›Read

Tutorial

  • Getting Started

Read

  • get
  • on
  • ref

Write

  • add
  • set
  • upsert
  • update
  • delete

FieldValue

  • inc
  • del
  • ts
  • union
  • remove

Atomic & Bulk

  • tx
  • batch

on

on works in place of firestore onSnapshot but with the same syntax as the sweetened get .

listen for doc changes

const unsubscribe = db.on("users", (docs) => {
  for(const user of docs){
    console.log(`${user.name} : ${user.age}`)
  }
})
// equivalent firestore
const unsubscribe = fb.onSnapShot("users", (docs) => {
  docs.forEach((ss) => {
    const user = ss.data()
    console.log(`${user.name} : ${user.age}`)
  }
})

onK and onS return the same values as getK and getS respectively.

← getref →
  • listen for doc changes
Firestore Sweet
Docs
Getting StartedAPI Reference
Who's Using Firesotre Sweet ?
WARASHIBEALISCHOOLcrypvoVePress
Where to Find Me ?
ALIS BlogGitHubStar
Follow @ocrybit
Copyright © 2020 Tomoya Nagasawa