firesage
Version:
🔥 Extremely High Precision Typescript Wrapper for Firestore Web, Providing Unparalleled Type Safe and Dev Experience
39 lines (38 loc) • 1.55 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getDocsFromServer = exports.getDocsFromCache = exports.getDocs = void 0;
var firestore_1 = require("firebase/firestore");
/**
* Executes the query and returns the results as a `QuerySnapshot`.
*
* Note: `getDocs()` attempts to provide up-to-date data when possible by
* waiting for data from the server, but it may return cached data or fail if
* you are offline and the server cannot be reached. To specify this behavior,
* invoke {@link getDocsFromCache} or {@link getDocsFromServer}.
*
* @returns A `Promise` that will be resolved with the results of the query.
*/
var getDocs = function (query) {
return (0, firestore_1.getDocs)(query);
};
exports.getDocs = getDocs;
/**
* Executes the query and returns the results as a `QuerySnapshot` from cache.
* Returns an error if the document is not currently cached.
*
* @returns A `Promise` that will be resolved with the results of the query.
*/
var getDocsFromCache = function (query) {
return (0, firestore_1.getDocsFromCache)(query);
};
exports.getDocsFromCache = getDocsFromCache;
/**
* Executes the query and returns the results as a `QuerySnapshot` from the
* server. Returns an error if the network is not available.
*
* @returns A `Promise` that will be resolved with the results of the query.
*/
var getDocsFromServer = function (query) {
return (0, firestore_1.getDocsFromServer)(query);
};
exports.getDocsFromServer = getDocsFromServer;