1 line
12 KiB
Text
1 line
12 KiB
Text
|
{"version":3,"file":"angular-fire-firestore-lite.js","sources":["../../../src/firestore/lite/lite.ts","../../../src/firestore/lite/lite.module.ts","../../../src/firestore/lite/rxfire.ts","../../../src/firestore/lite/firebase.ts","../../../src/firestore/lite/angular-fire-firestore-lite.ts"],"sourcesContent":["import { Firestore as FirebaseFirestore } from 'firebase/firestore/lite';\nimport { ɵgetAllInstancesOf } from '@angular/fire';\nimport { from, timer } from 'rxjs';\nimport { concatMap, distinct } from 'rxjs/operators';\n\n// see notes in core/firebase.app.module.ts for why we're building the class like this\n// tslint:disable-next-line:no-empty-interface\nexport interface Firestore extends FirebaseFirestore {}\n\nexport class Firestore {\n constructor(firestore: FirebaseFirestore) {\n return firestore;\n }\n}\n\nexport const FIRESTORE_PROVIDER_NAME = 'firestore/lite';\n\n// tslint:disable-next-line:no-empty-interface\nexport interface FirestoreInstances extends Array<FirebaseFirestore> {}\n\nexport class FirestoreInstances {\n constructor() {\n return ɵgetAllInstancesOf<FirebaseFirestore>(FIRESTORE_PROVIDER_NAME);\n }\n}\n\nexport const firestoreInstance$ = timer(0, 300).pipe(\n concatMap(() => from(ɵgetAllInstancesOf<FirebaseFirestore>(FIRESTORE_PROVIDER_NAME))),\n distinct(),\n);\n","import { NgModule, Optional, NgZone, InjectionToken, ModuleWithProviders, Injector } from '@angular/core';\nimport { Firestore as FirebaseFirestore } from 'firebase/firestore/lite';\nimport { AuthInstances } from '@angular/fire/auth';\nimport { ɵgetDefaultInstanceOf, ɵAngularFireSchedulers, VERSION } from '@angular/fire';\nimport { Firestore, FirestoreInstances, FIRESTORE_PROVIDER_NAME } from './lite';\nimport { FirebaseApps, FirebaseApp } from '@angular/fire/app';\nimport { registerVersion } from 'firebase/app';\nimport { AppCheckInstances } from '@angular/fire/app-check';\n\nexport const PROVIDED_FIRESTORE_INSTANCES = new InjectionToken<Firestore[]>('angularfire2.firestore-lite-instances');\n\nexport function defaultFirestoreInstanceFactory(provided: FirebaseFirestore[]|undefined, defaultApp: FirebaseApp) {\n const defaultFirestore = ɵgetDefaultInstanceOf<FirebaseFirestore>(FIRESTORE_PROVIDER_NAME, provided, defaultApp);\n return defaultFirestore && new Firestore(defaultFirestore);\n}\n\nexport function firestoreInstanceFactory(fn: (injector: Injector) => FirebaseFirestore) {\n return (zone: NgZone, injector: Injector) => {\n const firestore = zone.runOutsideAngular(() => fn(injector));\n return new Firestore(firestore);\n };\n}\n\nconst FIRESTORE_INSTANCES_PROVIDER = {\n provide: FirestoreInstances,\n deps: [\n [new Optional(), PROVIDED_FIRESTORE_INSTANCES ],\n ]\n};\n\nconst DEFAULT_FIRESTORE_INSTANCE_PROVIDER = {\n provide: Firestore,\n useFactory: defaultFirestoreInstanceFactory,\n deps: [\n [new Optional(), PROVIDED_FIRESTORE_INSTANCES ],\n FirebaseApp,\n ]\n};\n\n@NgModule({\n providers: [\n DEFAULT_FIRESTORE_INSTANCE_PROVIDER,\n FIRESTORE_INSTANCES_PROVIDER,\n ]\n})\nexport class FirestoreModule {\n constructor() {\n registerVersion('angularfire', VERSION.full, 'lite');\n }\n}\n\nexport function provideFirestore(fn: (injector: Injector) => FirebaseFirestore, ...deps: any[]): ModuleWithProviders<FirestoreModule> {\n return {\n ngModule: FirestoreModule,\n providers: [{\n provide: PROVIDED_FIRESTORE_INSTANCES,\n useFactory: firestoreInstanceFactory(fn),\n multi: true,\n deps: [\n NgZone,\n Injector,\n ɵAngularFireSchedulers,\n FirebaseApps,\n // Firestore+Auth work better if Auth is loaded first\n [new Optional(), AuthInstances ],\n [new Optional(), AppCheckInstances ],\n ...deps,\n ]\n }]\n };\n}\n","// DO NOT MODIFY, this file is autogenerated by tools/build.ts\nimport { ɵzoneWrap } from '@angular/fire';\nimport {\n collection as _collection,\n collectionData as _collectionData,\n doc as _doc,\n docData as _docData,\n snapToData as _snapToData,\n fromRef as _fromRef\n} f
|