From e52d014917eedcf79c20579029146fd0255704a0 Mon Sep 17 00:00:00 2001 From: OJ Kwon Date: Wed, 14 Dec 2016 16:45:05 -0800 Subject: [PATCH] fix(Observable): align type definition of subscriber with Observable - closes #2166 --- spec/operators/groupBy-spec.ts | 2 +- src/Observable.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/operators/groupBy-spec.ts b/spec/operators/groupBy-spec.ts index 8dbdab6aae..807a4a7c1d 100644 --- a/spec/operators/groupBy-spec.ts +++ b/spec/operators/groupBy-spec.ts @@ -1378,7 +1378,7 @@ describe('Observable.prototype.groupBy', () => { observer.complete(); }).groupBy( (x: number) => x % 2, - (x: string) => x + '!' + (x: number) => x + '!' ); expect(result instanceof MyCustomObservable).to.be.true; diff --git a/src/Observable.ts b/src/Observable.ts index 38e15ef0b8..e3c681bae0 100644 --- a/src/Observable.ts +++ b/src/Observable.ts @@ -37,7 +37,7 @@ export class Observable implements Subscribable { * can be `next`ed, or an `error` method can be called to raise an error, or * `complete` can be called to notify of a successful completion. */ - constructor(subscribe?: (this: Observable, subscriber: Subscriber) => TeardownLogic) { + constructor(subscribe?: (this: Observable, subscriber: Subscriber) => TeardownLogic) { if (subscribe) { this._subscribe = subscribe; } @@ -53,7 +53,7 @@ export class Observable implements Subscribable { * @param {Function} subscribe? the subscriber function to be passed to the Observable constructor * @return {Observable} a new cold observable */ - static create: Function = (subscribe?: (subscriber: Subscriber) => TeardownLogic) => { + static create: Function = (subscribe?: (subscriber: Subscriber) => TeardownLogic) => { return new Observable(subscribe); };