UNPKG

firesage

Version:

🔥 Extremely High Precision Typescript Wrapper for Firestore Web, Providing Unparalleled Type Safe and Dev Experience

22 lines (18 loc) • 904 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.addDoc = void 0; var firestore_1 = require("firebase/firestore"); var fieldValue_1 = require("../fieldValue"); /** Add a new document to specified CollectionReference with the given data, assigning it a document ID automatically. @param reference — A reference to the collection to add this document to. @param data — An Object containing the data for the new document. @returns A Promise resolved with a DocumentReference pointing to the newly created document after it has been written to the backend (Note that it won't resolve while you're offline). */ var addDoc = function (reference, data) { return (0, firestore_1.addDoc)( // @ts-expect-error reference, (0, fieldValue_1.removeFieldValueInhomogeneousProps)(data)); }; exports.addDoc = addDoc;