Hi there, I have a question regarding firestore query subscriptions:
When I add the same listener multiple times - will it fetch the data multiple times or is this somehow handled internally? So I don't want to get multiple updates and especially fetch the same data more often than necessary. Otherwise I would have to track it in an array which subscriber is active.
I need to know this as I have HOCs which register the subscribers on mount and unsubcribe it on unmount. But sometimes the HOC is used mutliple times in the same screen.
@BraunreutherA The native Firestore SDK handles this all for you and minimises traffic across the network. If you add multiple listeners, each will receive updates, but it will only fetch the data from Firestore once.
Most helpful comment
@BraunreutherA The native Firestore SDK handles this all for you and minimises traffic across the network. If you add multiple listeners, each will receive updates, but it will only fetch the data from Firestore once.