refactor: use isObservable provided by rxjs 6.1+ (#27668)

Refactor common, core, forms, router to use the isObservable method from rxjs 6.1+. Remove the isObservable method from core.

PR Close #27668
This commit is contained in:
Christopher Dahm
2018-12-14 12:19:26 -05:00
committed by Miško Hevery
parent 9e5065a778
commit 7e6350ce2e
13 changed files with 22 additions and 50 deletions

View File

@ -6,6 +6,7 @@
* found in the LICENSE file at https://angular.io/license
*/
import {Observable} from 'rxjs';
import {AfterContentChecked, AfterContentInit, AfterViewChecked, AfterViewInit, ChangeDetectorRef, DoCheck, ElementRef, ErrorHandler, EventEmitter, Injector, OnChanges, OnDestroy, OnInit, Renderer2, SimpleChange, TemplateRef, ViewContainerRef,} from '@angular/core';
import {getDebugContext} from '@angular/core/src/errors';
import {ArgumentType, DepFlags, NodeFlags, Services, anchorDef, asElementData, directiveDef, elementDef, providerDef, textDef} from '@angular/core/src/view/index';
@ -341,13 +342,11 @@ import {ARG_TYPE_VALUES, checkNodeInlineOrDynamic, createRootView, createAndGetR
let unsubscribeSpy: any;
class SomeService {
emitter = {
subscribe: (callback: any) => {
const subscription = emitter.subscribe(callback);
unsubscribeSpy = spyOn(subscription, 'unsubscribe').and.callThrough();
return subscription;
}
};
emitter = new Observable((callback: any) => {
const subscription = emitter.subscribe(callback);
unsubscribeSpy = spyOn(subscription, 'unsubscribe').and.callThrough();
return subscription;
});
}
const handleEvent = jasmine.createSpy('handleEvent');