Skip to content

Commit

Permalink
fix(Observer): fix Observable#subscribe() signature to suggest correc…
Browse files Browse the repository at this point in the history
…t usable

- Overloads subscribe signature for usage with an empty subscriber, PartialObserver<T>, or next, error and complete handlers
  • Loading branch information
awerlang authored Oct 1, 2016
1 parent e20cdb7 commit 459d2a2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Observable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ export class Observable<T> implements Subscribable<T> {
* @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<T>): Subscription;
subscribe(next?: (value: T) => void, error?: (error: any) => void, complete?: () => void): Subscription;
subscribe(observerOrNext?: PartialObserver<T> | ((value: T) => void),
error?: (error: any) => void,
complete?: () => void): Subscription {
Expand Down

0 comments on commit 459d2a2

Please sign in to comment.