MCPcopy Create free account
hub / github.com/NativeScript/firebase / get

Method get

packages/firebase-firestore/index.ios.ts:808–830  ·  view source on GitHub ↗
(options?: GetOptions)

Source from the content-addressed store, hash-verified

806 }
807
808 get(options?: GetOptions): Promise<DocumentSnapshot<T>> {
809 return new Promise((resolve, reject) => {
810 let source: FIRFirestoreSource;
811 switch (options) {
812 case GetOptions.Cache:
813 source = FIRFirestoreSource.Cache;
814 break;
815 case GetOptions.Server:
816 source = FIRFirestoreSource.Server;
817 break;
818 default:
819 source = FIRFirestoreSource.Default;
820 break;
821 }
822 this.native.getDocumentWithSourceCompletion(source, (ss, error) => {
823 if (error) {
824 reject(FirebaseError.fromNative(error));
825 } else {
826 resolve(DocumentSnapshot.fromNative(ss));
827 }
828 });
829 });
830 }
831
832 onSnapshot(observer: { complete?: () => void; error?: (error: Error) => void; next?: (snapshot: DocumentSnapshot<T>) => void }): () => void;
833 onSnapshot(options: SnapshotListenOptions, observer: { complete?: () => void; error?: (error: Error) => void; next?: (snapshot: DocumentSnapshot<T>) => void }): () => void;

Callers

nothing calls this directly

Calls 1

fromNativeMethod · 0.45

Tested by

no test coverage detected