From 459d2a2a43cc8f5e5d3f9f675142b334ce3c1791 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Werlang?= Date: Fri, 30 Sep 2016 21:06:18 -0300 Subject: [PATCH] fix(Observer): fix Observable#subscribe() signature to suggest correct usable - Overloads subscribe signature for usage with an empty subscriber, PartialObserver, or next, error and complete handlers --- src/Observable.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Observable.ts b/src/Observable.ts index 1269887d88..e21e2929eb 100644 --- a/src/Observable.ts +++ b/src/Observable.ts @@ -82,6 +82,9 @@ export class Observable implements Subscribable { * @param {Function} complete (optional) a handler for a terminal event resulting from successful completion. * @return {ISubscription} a subscription reference to the registered handlers */ + subscribe(): Subscription; + subscribe(observer: PartialObserver): Subscription; + subscribe(next?: (value: T) => void, error?: (error: any) => void, complete?: () => void): Subscription; subscribe(observerOrNext?: PartialObserver | ((value: T) => void), error?: (error: any) => void, complete?: () => void): Subscription {