Skip to content

Commit

Permalink
fix(Observable): Ensure the generic type of the Observer passed to Ob…
Browse files Browse the repository at this point in the history
…servable's initializer function is the same.

- closes #2166
  • Loading branch information
kwonoj authored and benlesh committed Jan 29, 2017
1 parent cb21993 commit 51a0bc1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion spec/operators/groupBy-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1406,7 +1406,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;
Expand Down
4 changes: 2 additions & 2 deletions src/Observable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export class Observable<T> implements Subscribable<T> {
* 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?: <R>(this: Observable<T>, subscriber: Subscriber<R>) => TeardownLogic) {
constructor(subscribe?: (this: Observable<T>, subscriber: Subscriber<T>) => TeardownLogic) {
if (subscribe) {
this._subscribe = subscribe;
}
Expand All @@ -53,7 +53,7 @@ export class Observable<T> implements Subscribable<T> {
* @param {Function} subscribe? the subscriber function to be passed to the Observable constructor
* @return {Observable} a new cold observable
*/
static create: Function = <T>(subscribe?: <R>(subscriber: Subscriber<R>) => TeardownLogic) => {
static create: Function = <T>(subscribe?: (subscriber: Subscriber<T>) => TeardownLogic) => {
return new Observable<T>(subscribe);
}

Expand Down

0 comments on commit 51a0bc1

Please sign in to comment.