ExhaustMap - Refactor - @deprecated resultSelector is no longer supported. Use inner map instead

63 Views Asked by At

I have this function and VS Code is warning me with this message @deprecated — resultSelector is no longer supported. Use inner map instead. Reading the RXJS documentation it says same behavior can be reproduced with the map operator, therefore this argument became deprecated.

Could someone help me transform it using Map (I don't understand how to do it).

exhaustMap((data: [any, Language]) => {
  if (data[0].type === 'mail') {
    return this.authServices.loginEmail(data[0]).pipe(
      map(
        (response: any) =>
          new AuthAct.LoginRedirect({
            url: environment.domainUrl + response.code
          })
      ),
      catchError(error => {
        this.notificationsService.handleError({
          error_key: 'login_error_message',
          info: error
        });
        return of(new AuthAct.ResetLoads());
      })
    );
  } else {

—}

0

There are 0 best solutions below