Replies: 1 comment 3 replies
-
You can move the navigation to the stats feature up in the main feature (stat feature become a child of main feature) or your summary feature could take a viewBuilder closure so it can build and navigate to stats without knowing how to build it. Then when you build the summary view you pass a view builder. One thing that I like to keep in mind is that your features (state, action, reducers ...) structure can vastly differ from the navigation hierarchy. Also as there is only one store you can pass a non scoped store to subviews, just be careful to scope it where you use it in viewStores. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello. I'm trying to figure what's the best way to model something like this
I have a
MainState
that holds into anrecords
array ofRecords
.MainView
is showing and manipulating it.MainState
has a child calledSummaryState
that does not need to know anything about therecords
. But thenSummaryState
has an optional piece of state calledStatisticsState
, that wants to showrecords
in various way by filtering/sorting it.I think using
Environment
to read/write torecords
array would remove a lot of the benefits of using TCA.Adding
records
toSummaryState
just so that it's then passed toStatisticsState
seems like a heavy solution that will be difficult to maintain.Any suggestions?
Beta Was this translation helpful? Give feedback.
All reactions