From 1a9fd42c7bd0f6e737379f8ac7f7ce749c9a642d Mon Sep 17 00:00:00 2001 From: Nicholas Jamieson Date: Sat, 2 Dec 2017 08:58:42 +1000 Subject: [PATCH] fix(typings): fix subscribe overloads (#3053) 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.