diff --git a/src/auth/auth.spec.ts b/src/auth/auth.spec.ts index 26c58d22e..84f7f44f1 100644 --- a/src/auth/auth.spec.ts +++ b/src/auth/auth.spec.ts @@ -1,15 +1,11 @@ import { User } from '@firebase/auth-types'; import { ReflectiveInjector, Provider } from '@angular/core'; -import { Observable } from 'rxjs/Observable' -import { Subject } from 'rxjs/Subject' -import { Observer } from 'rxjs/Observer'; +import { Observable, Subject } from 'rxjs' import { TestBed, inject } from '@angular/core/testing'; -import { _do } from 'rxjs/operator/do'; -import { take } from 'rxjs/operator/take'; -import { skip } from 'rxjs/operator/skip'; import { FirebaseApp, FirebaseAppConfig, AngularFireModule, FirebaseAppName } from 'angularfire2'; import { AngularFireAuth, AngularFireAuthModule } from 'angularfire2/auth'; import { COMMON_CONFIG } from './test-config'; +import { take, skip } from 'rxjs/operators'; function authTake(auth: Observable, count: number): Observable { return take.call(auth, 1); diff --git a/src/auth/auth.ts b/src/auth/auth.ts index 4ceb4feb5..3ee817741 100644 --- a/src/auth/auth.ts +++ b/src/auth/auth.ts @@ -1,13 +1,13 @@ import { FirebaseAuth, User } from '@firebase/auth-types'; import { FirebaseOptions } from '@firebase/app-types'; import { Injectable, Inject, Optional, NgZone, PLATFORM_ID } from '@angular/core'; -import { Observable } from 'rxjs/Observable'; +import { Observable } from 'rxjs'; +import { switchMap } from 'rxjs/operators'; +import { of } from 'rxjs/observable/of'; +import { from } from 'rxjs/observable/from'; import { FirebaseAppConfig, FirebaseAppName, _firebaseAppFactory, FirebaseZoneScheduler } from 'angularfire2'; -import 'rxjs/add/operator/switchMap'; -import 'rxjs/add/observable/of'; -import 'rxjs/add/observable/fromPromise'; @Injectable() export class AngularFireAuth { @@ -55,10 +55,9 @@ export class AngularFireAuth { return { unsubscribe }; }) ) - ).switchMap((user:User|null) => { - return user ? Observable.fromPromise(user.getIdToken()) : Observable.of(null) - }); - + ).pipe(switchMap((user:User) => { + return user ? from(user.getIdToken()) : of(null) + })); } }