refactor(core): remove isObservable TODO#39669
refactor(core): remove isObservable TODO#39669petebacondarwin wants to merge 1 commit intoangular:masterfrom
Conversation
This commit removes the TODO comment that proposed that we use the built-in RxJS `isObservable()` function. This is not a viable approach since the built-in function requires that the `obj` contains additional methods that our "observable" types (such as `EventEmitter`) do not necessarily have. See angular#39643 for more information.
| export function isObservable(obj: any|Observable<any>): obj is Observable<any> { | ||
| // 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'; |
There was a problem hiding this comment.
To be fair, shouldn't this method be renamed to isSubscribable? It literally checks whether the given object can be subscribed to.
There was a problem hiding this comment.
I agree, but to be consistent that is a bigger change, which would involve us changing our use of Observable to Subscribable across the framework.
There was a problem hiding this comment.
Yea, agreed. This is also somewhat addressed in #39627 where it actually is renamed to isSubscribable and isObservable is still exported as a type assertion on that function.
This commit removes the TODO comment that proposed that we use the built-in RxJS `isObservable()` function. This is not a viable approach since the built-in function requires that the `obj` contains additional methods that our "observable" types (such as `EventEmitter`) do not necessarily have. See #39643 for more information. PR Close #39669
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
This commit removes the TODO comment that proposed
that we use the built-in RxJS
isObservable()function.This is not a viable approach since the built-in function
requires that the
objcontains additional methods thatour "observable" types (such as
EventEmitter) do notnecessarily have.
See #39643 for more information.