Skip to content

Instantly share code, notes, and snippets.

View Crypt0Graphic's full-sized avatar

Crypt0Graphic

  • İstanbul / Türkiye
View GitHub Profile
@Crypt0Graphic
Crypt0Graphic / firestore.service.ts
Last active May 26, 2024 20:12
Generic Firestore Service for Angular (Firebase SDK 10+)
// Tested in Angular 17+ with Firebase SDK 10+
import { Injectable, inject } from '@angular/core';
import { Firestore, QueryConstraint, collection, getDocs } from '@angular/fire/firestore';
import { CollectionReference, addDoc, deleteDoc, doc, getDoc, query, setDoc, updateDoc } from '@firebase/firestore';
import { Observable, from, map } from 'rxjs';
@Injectable({
providedIn: 'root'
})