Created
September 6, 2018 18:32
-
-
Save sle-c/1637e679297cebbb7b5d288a2fe75bc6 to your computer and use it in GitHub Desktop.
Subscribe to firebase activities with counter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function handleActivitySubscription(snapshot) { | |
snapshot.docChanges().forEach(function(change) { | |
doSomething(change.doc.data()); | |
}); | |
} | |
const handleActivitySubscriptionWithCounter = | |
createFnCounter(handleActivitySubscription, 1); | |
db.collection("activities").where("userID", "==", currentUserID) | |
.onSnapshot(handleActivitySubscriptionWithCounter); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment