Skip to content

Instantly share code, notes, and snippets.

@victorbrndls
Created February 7, 2022 22:51
Show Gist options
  • Save victorbrndls/a87d7d59b5050c85058c57a485e3b60e to your computer and use it in GitHub Desktop.
Save victorbrndls/a87d7d59b5050c85058c57a485e3b60e to your computer and use it in GitHub Desktop.
@NonNull
synchronized FirebaseFirestore get(@NonNull String databaseId) {
FirebaseFirestore firestore = instances.get(databaseId);
if (firestore == null) {
firestore = FirebaseFirestore.newInstance(...);
instances.put(databaseId, firestore);
}
return firestore;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment