Skip to content

Commit

Permalink
fix(Observable): remove redundant reduce overload
Browse files Browse the repository at this point in the history
The first overload signature for `reduce` is redundant, since it is simply a special case of the `reduce<T, R>` overload. Its presence breaks type inference when the type of the source observable items and the accumulator differ.
  • Loading branch information
masaeedu committed Mar 21, 2017
1 parent 01e1343 commit 51cd11b
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/operator/reduce.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { Operator } from '../Operator';
import { Subscriber } from '../Subscriber';

/* tslint:disable:max-line-length */
export function reduce<T>(this: Observable<T>, accumulator: (acc: T, value: T, index: number) => T, seed?: T): Observable<T>;
export function reduce<T>(this: Observable<T>, accumulator: (acc: T[], value: T, index: number) => T[], seed?: T[]): Observable<T[]>;
export function reduce<T, R>(this: Observable<T>, accumulator: (acc: R, value: T, index: number) => R, seed?: R): Observable<R>;
/* tslint:enable:max-line-length */
Expand Down

0 comments on commit 51cd11b

Please sign in to comment.