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

115
Vistas
Add to state from Redux middleware

I've created a redux middleware used for calling my API.

For better debugging I've also implemented status for each of the objects in my state.

Now I have to do this in every case of all reducers:

    case SET_USER:
      return {
        ...state,
        workspaces: action.response.data.workspaces,
        status: action.status, <--
      }

Which is pretty repetetive. Is there any way I can change the state (at the correct place) each time automatically?

I do have access to the action type, maybe I could use that somehow?

about 4 years ago · Juan Pablo Isaza
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