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

215
Vistas
Questions about Redux Thunk Middleware

i really need help.

I'm confused about how should i manage my async API Calls and error handling using redux thunk middleware.

Option 1

Send essential info to redux thunk middleware (newJobInfo) and ALSO other functions to manage my component state (for example, disable submitting button while making api call)

Error handling: Inside redux thunk middleware using try { } catch { }

enter image description here

Option 2

Keep this functions inside my component and only send essential data to redux thunk middleware

Error handling: Remove try { } catch { } of redux thunk middleware (or keep it and throw new Error inside catch statement) and manage errors with .then() and .catch() inside my component.

enter image description here

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

0

In this case, I would think how do I use this action in my project. For example, if I use need to call 'startUpdatingJob' not only with navigate effect, I will use option 2, otherwise, if I only use it once, it is acceptable to use option 1. But in general I would rather use option 2, in this case we keep action logic more consistent, as it has only 1 task to complete.

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