Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

213
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda