I need to place an approximately 20 Vue component on the page. Each component, when mounted, creates an onSnapshot for itself and, accordingly, unsubscribe() when it is deleted.
const ref = firebase.firestore().collection('components').doc('comp1')
var unsubscribe = ref.onSnapshot(querySnapshot => {
querySnapshot.forEach(doc => {
...
})
}
What is the cost of each onSnapshot / unsubscribe :
- in the sense of the execution time
- in the sense of money (according to the price of Firebase)
How much will I pay, for example, if each of 1000 users update a page with 20 components 100 times in half an hour?
Perhaps it would be better to make onSnapshot on the whole collection of components?
onSnapshotfor the whole collection of components? That's better? - Alexander