Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

116
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!