Skip to content

Commit

Permalink
fix: remove misused type parameter from isObservable (#6083)
Browse files Browse the repository at this point in the history
* fix: remove misused type param from isObserable

* chore: update api_guardian
  • Loading branch information
cartant authored Mar 8, 2021
1 parent 42cee80 commit f16b634
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion api_guard/dist/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ export interface InteropObservable<T> {

export declare function interval(period?: number, scheduler?: SchedulerLike): Observable<number>;

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

export declare function lastValueFrom<T>(source: Observable<T>): Promise<T>;

Expand Down
3 changes: 2 additions & 1 deletion src/internal/util/isObservable.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
/** prettier */
import { Observable } from '../Observable';
import { isFunction } from './isFunction';

/**
* Tests to see if the object is an RxJS {@link Observable}
* @param obj the object to test
*/
export function isObservable<T>(obj: any): obj is Observable<T> {
export function isObservable(obj: any): obj is Observable<unknown> {
// The !! is to ensure that this publicly exposed function returns
// `false` if something like `null` or `0` is passed.
return !!obj && (obj instanceof Observable || (isFunction(obj.lift) && isFunction(obj.subscribe)));
Expand Down

0 comments on commit f16b634

Please sign in to comment.