1 line
12 KiB
Text
1 line
12 KiB
Text
|
{"version":3,"file":"angular-fire-database.js","sources":["../../../src/database/database.ts","../../../src/database/database.module.ts","../../../src/database/rxfire.ts","../../../src/database/firebase.ts","../../../src/database/angular-fire-database.ts"],"sourcesContent":["import { Database as FirebaseDatabase } from 'firebase/database';\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 Database extends FirebaseDatabase {}\n\nexport class Database {\n constructor(database: FirebaseDatabase) {\n return database;\n }\n}\n\nexport const DATABASE_PROVIDER_NAME = 'database';\n\n// tslint:disable-next-line:no-empty-interface\nexport interface DatabaseInstances extends Array<FirebaseDatabase> {}\n\nexport class DatabaseInstances {\n constructor() {\n return ɵgetAllInstancesOf<FirebaseDatabase>(DATABASE_PROVIDER_NAME);\n }\n}\n\nexport const databaseInstance$ = timer(0, 300).pipe(\n concatMap(() => from(ɵgetAllInstancesOf<FirebaseDatabase>(DATABASE_PROVIDER_NAME))),\n distinct(),\n);\n","import { NgModule, Optional, NgZone, InjectionToken, ModuleWithProviders, Injector } from '@angular/core';\nimport { Database as FirebaseDatabase } from 'firebase/database';\nimport { AuthInstances } from '@angular/fire/auth';\nimport { ɵgetDefaultInstanceOf, ɵAngularFireSchedulers, VERSION } from '@angular/fire';\nimport { Database, DatabaseInstances, DATABASE_PROVIDER_NAME } from './database';\nimport { FirebaseApps, FirebaseApp } from '@angular/fire/app';\nimport { registerVersion } from 'firebase/app';\nimport { AppCheckInstances } from '@angular/fire/app-check';\n\nexport const PROVIDED_DATABASE_INSTANCES = new InjectionToken<Database[]>('angularfire2.database-instances');\n\nexport function defaultDatabaseInstanceFactory(provided: FirebaseDatabase[]|undefined, defaultApp: FirebaseApp) {\n const defaultDatabase = ɵgetDefaultInstanceOf<FirebaseDatabase>(DATABASE_PROVIDER_NAME, provided, defaultApp);\n return defaultDatabase && new Database(defaultDatabase);\n}\n\nexport function databaseInstanceFactory(fn: (injector: Injector) => FirebaseDatabase) {\n return (zone: NgZone, injector: Injector) => {\n const database = zone.runOutsideAngular(() => fn(injector));\n return new Database(database);\n };\n}\n\nconst DATABASE_INSTANCES_PROVIDER = {\n provide: DatabaseInstances,\n deps: [\n [new Optional(), PROVIDED_DATABASE_INSTANCES ],\n ]\n};\n\nconst DEFAULT_DATABASE_INSTANCE_PROVIDER = {\n provide: Database,\n useFactory: defaultDatabaseInstanceFactory,\n deps: [\n [new Optional(), PROVIDED_DATABASE_INSTANCES ],\n FirebaseApp,\n ]\n};\n\n@NgModule({\n providers: [\n DEFAULT_DATABASE_INSTANCE_PROVIDER,\n DATABASE_INSTANCES_PROVIDER,\n ]\n})\nexport class DatabaseModule {\n constructor() {\n registerVersion('angularfire', VERSION.full, 'rtdb');\n }\n}\n\nexport function provideDatabase(fn: (injector: Injector) => FirebaseDatabase, ...deps: any[]): ModuleWithProviders<DatabaseModule> {\n return {\n ngModule: DatabaseModule,\n providers: [{\n provide: PROVIDED_DATABASE_INSTANCES,\n useFactory: databaseInstanceFactory(fn),\n multi: true,\n deps: [\n NgZone,\n Injector,\n ɵAngularFireSchedulers,\n FirebaseApps,\n // Database+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 fromRef as _fromRef,\n stateChanges as _stateChanges,\n list as _list,\n listVal as _listVal,\n auditTrail as _auditTrail,\n object as _object,\n objectVal as _objectVal,\n changeToData as _changeToData\n} from 'rxfire/database';\n\nexport {\n ListenEvent,\n Lis
|