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

Method add

packages/firebase-firestore/index.ios.ts:731–741  ·  view source on GitHub ↗
(data: T)

Source from the content-addressed store, hash-verified

729 }
730
731 add(data: T) {
732 return new Promise<DocumentReference<T>>((resolve, reject) => {
733 const ref = this.native.addDocumentWithDataCompletion(serializeItems(data), (error) => {
734 if (error) {
735 reject(FirebaseError.fromNative(error));
736 } else {
737 resolve(DocumentReference.fromNative(ref));
738 }
739 });
740 });
741 }
742
743 doc(documentPath?: string) {
744 return DocumentReference.fromNative(documentPath ? this.native.documentWithPath(documentPath) : this.native.documentWithAutoID());

Callers

nothing calls this directly

Calls 2

serializeItemsFunction · 0.70
fromNativeMethod · 0.45

Tested by

no test coverage detected