Skip to content

Commit

Permalink
fix(startWith): fix incorrect types (#5157)
Browse files Browse the repository at this point in the history
This change does not effect the user-facing function overloads, so the function's public signature remains unchanged. This incorrect typing was visible in the docs however, so this change can be thought of as a documentation change.
  • Loading branch information
jorroll authored and benlesh committed Jan 22, 2020
1 parent 86b6a27 commit faaae75
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/internal/operators/startWith.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,13 @@ export function startWith<T, D = T>(...array: Array<D | SchedulerLike>): Operato
* @method startWith
* @owner Observable
*/
export function startWith<T, D>(...array: Array<T | SchedulerLike>): OperatorFunction<T, T | D> {
export function startWith<T, D>(...array: Array<D | SchedulerLike>): OperatorFunction<T, T | D> {
const scheduler = array[array.length - 1] as SchedulerLike;
if (isScheduler(scheduler)) {
// deprecated path
array.pop();
return (source: Observable<T>) => concat(array as T[], source, scheduler);
return (source: Observable<T>) => concat(array as D[], source, scheduler);
} else {
return (source: Observable<T>) => concat(array as T[], source);
return (source: Observable<T>) => concat(array as D[], source);
}
}

0 comments on commit faaae75

Please sign in to comment.