1.0.4 • Published 2 years ago
wrapped-firebase v1.0.4
wrapped-firebase
a small firebase library for improved error handling
Installation
npm i wrapped-firebase
Example
import { getAuth } from "firebase/auth";
import { getFirestore } from "firebase/firestore";
import { fetchFirestoreDocument } from "wrapped-firebase";
const ref = doc(getFirestore(), "users", getAuth().currentUser.uid!);
const [res, error] = await fetchFirestoreDocument(ref);
if (error) {
// handle
} else {
cache(res);
}