Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Firestore multiple Subscribers #647

Closed
BraunreutherA opened this issue Nov 26, 2017 · 1 comment
Closed

Firestore multiple Subscribers #647

BraunreutherA opened this issue Nov 26, 2017 · 1 comment

Comments

@BraunreutherA
Copy link

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.

Environment

  1. Application Target Platform: Both
  2. Development Operating System: macOS 10.13
  3. React Native version: 0.48.4
  4. RNFirebase Version: 3.0.3
  5. Firebase Module: Firestore
@chrisbianca
Copy link
Contributor

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants