rxfire icon indicating copy to clipboard operation
rxfire copied to clipboard

[exp] Firestore rxfire function names match Firebase SDK names

Open jhuleatt opened this issue 4 years ago • 2 comments

In v9 of the Firebase SDK, firebase/firestore exports doc and collection as functions. It may be confusing for developers to have to always remember to be careful with their imports. For example, they'd have to do:

import { doc } from "firebase/firestore";
import { doc as doc$ } from "rxfire/firestore";

const colorDoc = doc(firestoreInstance, "colors", "blue");
doc$.subscribe(colorDoc, () => {
  /* ... */
});

Maybe we should change the names of rxfire's doc and collection? Maybe docSnapshots and querySnapshots?

jhuleatt avatar Jul 13 '21 19:07 jhuleatt

I like the doc$ function alias or a getDoc$ function alias. Let's start with updating the current firestore examples to eliminate the name errors.

voscausa avatar Sep 10 '21 22:09 voscausa

They probably may be named like angular/fire does: link

  • doc -> docSnapshots
  • collection -> collectionSnapshots

image

daguttt avatar Apr 01 '23 18:04 daguttt