Skip to content

Commit

Permalink
fix(@angular-devkit/core): remove deprecated isObservable function
Browse files Browse the repository at this point in the history
BREAKING CHANGE:
Deprecated `isObservable` function removed.  As an alternative, use `isObservable` from the `rxjs` package.
NOTE: This change does not affect application development.
  • Loading branch information
clydin committed Oct 7, 2020
1 parent f9d5960 commit 660f214
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 20 deletions.
2 changes: 0 additions & 2 deletions etc/api/angular_devkit/core/src/_golden-api.d.ts
Expand Up @@ -308,8 +308,6 @@ export declare function isJsonArray(value: JsonValue): value is JsonArray;

export declare function isJsonObject(value: JsonValue): value is JsonObject;

export declare function isObservable(obj: any | Observable<any>): obj is Observable<any>;

export declare function isPromise(obj: any): obj is Promise<any>;

export declare function join(p1: Path, ...others: string[]): Path;
Expand Down
18 changes: 0 additions & 18 deletions packages/angular_devkit/core/src/utils/lang.ts
Expand Up @@ -6,7 +6,6 @@
* found in the LICENSE file at https://angular.io/license
*/
// Borrowed from @angular/core
import { Observable } from 'rxjs';

/**
* Determine if the argument is shaped like a Promise
Expand All @@ -17,20 +16,3 @@ export function isPromise(obj: any): obj is Promise<any> {
// It's up to the caller to ensure that obj.then conforms to the spec
return !!obj && typeof obj.then === 'function';
}

/**
* Determine if the argument is an Observable
* @deprecated as of 8.0; use rxjs' built-in version
*/
// tslint:disable-next-line:no-any
export function isObservable(obj: any | Observable<any>): obj is Observable<any> {
if (!obj || typeof obj !== 'object') {
return false;
}

if (Symbol.observable && Symbol.observable in obj) {
return true;
}

return typeof obj.subscribe === 'function';
}

0 comments on commit 660f214

Please sign in to comment.