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

120
Visualizações
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 à 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