sveltedfire 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { getAuth } from "firebase/auth";
|
|
1
2
|
import { getFirestore, collection, doc, getDoc } from "firebase/firestore";
|
|
2
3
|
export const fetchDoc = async (...docPath) => {
|
|
4
|
+
const auth = getAuth(); // Initialize auth so that requests are authenticated
|
|
3
5
|
const db = getFirestore();
|
|
4
6
|
let theRef;
|
|
5
7
|
if (docPath.length > 2) {
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { getAuth } from "firebase/auth";
|
|
1
2
|
import { getFirestore, collection, doc, getDocs, Query, QueryFieldFilterConstraint, where, query, QueryCompositeFilterConstraint } from "firebase/firestore";
|
|
2
3
|
export const fetchDocs = (...collectionPath) => async (qOrField = null, comparator = null, value = null) => {
|
|
4
|
+
const auth = getAuth(); // Initialize auth so that requests are authenticated
|
|
3
5
|
const db = getFirestore();
|
|
4
6
|
let theRef;
|
|
5
7
|
if (collectionPath.length > 1) {
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { getAuth } from "firebase/auth";
|
|
1
2
|
import { getFirestore, collection, doc, onSnapshot } from "firebase/firestore";
|
|
2
3
|
import { readable } from 'svelte/store';
|
|
3
4
|
export const listenDoc = (...docPath) => {
|
|
5
|
+
const auth = getAuth(); // Initialize auth so that requests are authenticated
|
|
4
6
|
const db = getFirestore();
|
|
5
7
|
let theRef;
|
|
6
8
|
if (docPath.length > 2) {
|