Skip to content

rxjs migration, return of pipe() #6415

Answered by raymonddavis
Gamewalker asked this question in Q&A
Discussion options

You must be logged in to vote

So I am not sure what caused the change but if errorHandling is a variable then it will not be able to get the correct type information from the place it is being used.

public errorHandling<T>(): OperatorFunction<T, T> {
    return catchError((err: any) => {
      this.loggingService.error('--------- API ERROR ---------', err.message, '------- API ERROR ENDE ------');

      ....

      return EMPTY;
    });
  }

If you make that variable into a function that takes the generics you can handle the typing.

The stackblitz is here
https://stackblitz.com/edit/rxjs-pipe-issue

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Gamewalker
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants