Handling multiple levels of nested collections #626
-
So I have been looking at the collections-related case studies and code examples in the docs, and I cannot find something similar to my case. All examples have a 2-level, very straightforward child-parent relationships where you would want to have a child domain and parent domain, with each one of them having their owns states, actions, environments, and reducers. In my use case I have a sectionalized list of items where you have 3-level:
Now I could simply have the three domains separated totally but that would significantly complicate the structure for no value as the sections are being used solely for cosmetic/presentational reasons (visually grouping the same day's events). No actions can ever be made in the section level and absolutely no dependencies are needed. Anyone has a similar case? What approach you went with? P.S. I tried to create 3 separate states for the 3 domains, but without adding an action for the section level. The idea was to leverage the middle level as a tunnel and just pass things around, for some reason though I could never get that to build. Something wrong is happening when using |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I had a similar use case and I created a |
Beta Was this translation helpful? Give feedback.
I had a similar use case and I created a
ViewState
that represented the parent-child relationship and theStore
had an array of all the children. TheViewState
is recomputed every time the domain is updated. In my use case, the number of items is bounded to be less than 50. So this approach worked for me.