Skip to content

Commit

Permalink
fix(core): Update to rxjs pipeable operators (#1620)
Browse files Browse the repository at this point in the history
  • Loading branch information
jymdman authored and jamesdaniels committed May 11, 2018
1 parent 5694e7c commit 3fbbb7d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/core/angularfire2.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Reference } from '@firebase/database-types';
import { TestBed, inject, withModule, async } from '@angular/core/testing';
import { ReflectiveInjector, Provider, PlatformRef, NgModule, Compiler, ApplicationRef, CompilerFactory } from '@angular/core';
import { FirebaseApp, FirebaseAppConfig, AngularFireModule } from 'angularfire2';
import { Subscription } from 'rxjs/Subscription';
import { Subscription } from 'rxjs';
import { COMMON_CONFIG } from './test-config';
import { BrowserModule } from '@angular/platform-browser';

Expand Down
10 changes: 4 additions & 6 deletions src/core/angularfire2.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
import { InjectionToken, NgZone } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import { Subscription } from 'rxjs/Subscription';
import { queue } from 'rxjs/scheduler/queue';
import { isPlatformServer } from '@angular/common';
import { observeOn } from 'rxjs/operator/observeOn';
import { Observable, Subscription } from 'rxjs';
import { queue } from 'rxjs/scheduler/queue';
import { first } from 'rxjs/operators';

import firebase from '@firebase/app';
import { FirebaseApp, FirebaseOptions } from '@firebase/app-types';

import {} from 'zone.js';
import 'rxjs/add/operator/first';

export const FirebaseAppName = new InjectionToken<string>('angularfire2.appName');
export const FirebaseAppConfig = new InjectionToken<FirebaseOptions>('angularfire2.config');
Expand All @@ -28,7 +26,7 @@ export class FirebaseZoneScheduler {
return new Observable<T>(subscriber => {
const noop = () => {};
const task = Zone.current.scheduleMacroTask('firebaseZoneBlock', noop, {}, noop, noop);
obs$.first().subscribe(() => this.zone.runOutsideAngular(() => task.invoke()));
obs$.pipe(first()).subscribe(() => this.zone.runOutsideAngular(() => task.invoke()));
return obs$.subscribe(subscriber);
});
} else {
Expand Down

0 comments on commit 3fbbb7d

Please sign in to comment.