Skip to content

Commit e52d014

Browse files
committed
fix(Observable): align type definition of subscriber with Observable
- closes #2166
1 parent 5f93f81 commit e52d014

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

spec/operators/groupBy-spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1378,7 +1378,7 @@ describe('Observable.prototype.groupBy', () => {
13781378
observer.complete();
13791379
}).groupBy(
13801380
(x: number) => x % 2,
1381-
(x: string) => x + '!'
1381+
(x: number) => x + '!'
13821382
);
13831383

13841384
expect(result instanceof MyCustomObservable).to.be.true;

src/Observable.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export class Observable<T> implements Subscribable<T> {
3737
* can be `next`ed, or an `error` method can be called to raise an error, or
3838
* `complete` can be called to notify of a successful completion.
3939
*/
40-
constructor(subscribe?: <R>(this: Observable<T>, subscriber: Subscriber<R>) => TeardownLogic) {
40+
constructor(subscribe?: (this: Observable<T>, subscriber: Subscriber<T>) => TeardownLogic) {
4141
if (subscribe) {
4242
this._subscribe = subscribe;
4343
}
@@ -53,7 +53,7 @@ export class Observable<T> implements Subscribable<T> {
5353
* @param {Function} subscribe? the subscriber function to be passed to the Observable constructor
5454
* @return {Observable} a new cold observable
5555
*/
56-
static create: Function = <T>(subscribe?: <R>(subscriber: Subscriber<R>) => TeardownLogic) => {
56+
static create: Function = <T>(subscribe?: (subscriber: Subscriber<T>) => TeardownLogic) => {
5757
return new Observable<T>(subscribe);
5858
};
5959

0 commit comments

Comments
 (0)