diff --git a/packages/core/src/util/lang.ts b/packages/core/src/util/lang.ts index 77a2355767..1cd63a1b0c 100644 --- a/packages/core/src/util/lang.ts +++ b/packages/core/src/util/lang.ts @@ -19,9 +19,13 @@ export function isPromise(obj: any): obj is Promise { /** * Determine if the argument is an Observable + * + * Strictly this tests that the `obj` is `Subscribable`, since `Observable` + * types need additional methods, such as `lift()`. But it is adequate for our + * needs since within the Angular framework code we only ever need to use the + * `subscribe()` method, and RxJS has mechanisms to wrap `Subscribable` objects + * into `Observable` as needed. */ export function isObservable(obj: any|Observable): obj is Observable { - // TODO: use isObservable once we update pass rxjs 6.1 - // https://github.com/ReactiveX/rxjs/blob/master/CHANGELOG.md#610-2018-05-03 return !!obj && typeof obj.subscribe === 'function'; }