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

117
Vistas
Redux store shape depending on another state value

I am developing an app using React and Redux which has, over time, evolved two modes, which have different state shapes. The modes are mutually exclusive, and the user selects the mode when the app loads. The mode is then fixed, and cannot be changed by the user.

The store has simply accumulated state relating to these two modes, but this seems incorrect - the mutual exclusivity of the two modes should surely be reflected in the store shape, and it should only contain state relating to the active mode.

Clearly some kind of conditional logic is required, but I'm not sure how to implement this - I mean this must be a fairly common pattern, but I can't seem to find Redux-based examples. There is a mode state entry, and it's the value of this that would determine the store shape. So one part of the store shape is itself dependent on another part of the store state.

I breifly considering having multiple stores, but then dismissed the idea.

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