From b0fa6113372307ade78a94b13c67151ecfa1f79f Mon Sep 17 00:00:00 2001 From: Nicholas Jamieson Date: Tue, 7 Nov 2017 07:07:12 +1000 Subject: [PATCH] fix(typings): fix subscribe overloads Remove the no-arg overload. If not removed, any Observable will be compatible with any ObservableInput regardless of type - as T does not appear in the no-arg overload. Closes #3052 --- src/Observable.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Observable.ts b/src/Observable.ts index d09810c843..74bc9af34f 100644 --- a/src/Observable.ts +++ b/src/Observable.ts @@ -73,8 +73,7 @@ export class Observable implements Subscribable { return observable; } - subscribe(): Subscription; - subscribe(observer: PartialObserver): Subscription; + subscribe(observer?: PartialObserver): Subscription; subscribe(next?: (value: T) => void, error?: (error: any) => void, complete?: () => void): Subscription; /** * Invokes an execution of an Observable and registers Observer handlers for notifications it will emit.