Skip to content

Commit

Permalink
Revert "refactor(catchError): add type overloads for functions that d…
Browse files Browse the repository at this point in the history
…o not return (#3421)" (#3425)

This reverts commit b1e5d3a.
  • Loading branch information
benlesh committed Mar 13, 2018
1 parent 9244089 commit 1b69bd6
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions src/internal/operators/catchError.ts
Expand Up @@ -4,19 +4,7 @@ import { Observable } from '../Observable';

import { OuterSubscriber } from '../OuterSubscriber';
import { subscribeToResult } from '../util/subscribeToResult';
import { ObservableInput, OperatorFunction, MonoTypeOperatorFunction } from '../types';

export function catchError<T>(
selector: (err: any, caught: Observable<T>) => never
): MonoTypeOperatorFunction<T>;

export function catchError<T>(
selector: (err: any, caught: Observable<T>) => ObservableInput<T>
): MonoTypeOperatorFunction<T>;

export function catchError<T, R>(
selector: (err: any, caught: Observable<T>) => ObservableInput<R>
): OperatorFunction<T, R>;
import { ObservableInput, OperatorFunction } from '../types';

/**
* Catches errors on the observable to be handled by returning a new observable or throwing an error.
Expand Down Expand Up @@ -75,7 +63,7 @@ export function catchError<T, R>(
* catch `selector` function.
* @name catchError
*/
export function catchError<T, R>(selector: (err: any, caught: Observable<T>) => ObservableInput<R>|never): OperatorFunction<T, T | R> {
export function catchError<T, R>(selector: (err: any, caught: Observable<T>) => ObservableInput<R>): OperatorFunction<T, T | R> {
return function catchErrorOperatorFunction(source: Observable<T>): Observable<T | R> {
const operator = new CatchOperator(selector);
const caught = source.lift(operator);
Expand Down

0 comments on commit 1b69bd6

Please sign in to comment.