I’m currently struggling with determining the optimal state shape in Redux/RTK to represent the complex data structure, with it’s multiple nested properties, dynamically created properties, and cascading updates.
Here’s a simplified overview of the structure I’m working with:
- groupingSlice
- basicDetail
- currentPhase
- numerousProperties
- phases
- phase1
- someProperty
- nestedProperty
- subProperty1
- subProperty2
- subSubProperty
- otherNestedProperties
- phase2
- an initial clone of phase 1
- phase3
- an initial clone of phase 2
- otherTopLevelSlices
While I’m aware that Redux best practices advocate for a flat state structure resembling database normalisation, I’m unsure how to apply this to my scenario, particularly concerning the management of dynamically created phases.
I’ve considered using nested slices that could be shared among all phase slices, but I’m uncertain about whether this is feasible and how action creators would effectively target specific phase slices for updates.
As someone new to Redux/RTK, I’m open to any advice or recommendations on the best approach to handle this data structure efficiently.
Looking for advice before diving into code. I appreciate any help.