Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

84
Vistas
Compruebe si la respuesta no se devolvió en 8 segundos

Tengo un método en mi componente Angular, que devuelve datos.

Aquí está este método

 getRecognitionById() { this.loaderService.show(null, true); forkJoin( this.vendorWebApiService.getRecognitionById(this.executiveChangeId), this.vendorWebApiService.getLatestFeedback(this.executiveChangeId)).pipe(take(1)) .subscribe(res => { this.recognitionData = res[0]; this.latestFeedback = res[1]; this.generateResponseFeedbackGroup(); this.loaderService.hide(true); }); }

Necesito verificar si la respuesta no apareció en 8 segundos, alertar al usuario como alert(response.exceptionMessage);

¿Como puedo hacer esto?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Podrías usar el operador de timeout de espera:

 // import { throwError, TimeoutError } from 'rxjs'; // import { catchError, timeout } from 'rxjs/operators'; getRecognitionById() { this.loaderService.show(null, true); forkJoin( this.vendorWebApiService.getRecognitionById(this.executiveChangeId), this.vendorWebApiService.getLatestFeedback(this.executiveChangeId)).pipe( take(1), timeout(8000), catchError((err) => { if (err instanceof TimeoutError) { // alert(response.exceptionMessage); } return throwError(err); }), ) .subscribe(res => { this.recognitionData = res[0]; this.latestFeedback = res[1]; this.generateResponseFeedbackGroup(); this.loaderService.hide(true); }); }
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda