Replies: 1 comment 1 reply
-
Hi @jay-linger, I made need to see some sample code to fully understand, but typically you would model this as having some detail state that contains an ID: struct DetailState: Identifiable {
let id: UUID
…
} And then your feature holds onto an identified array of that state: struct FeatureState {
var rows: IdentifiedArrayOf<DetailState>
} In this case both the list feature and the detail have access to the ID. I also do not think that putting the ID in the environment is appropriate. The environment is best suited for holding dependencies that need to interact with the outside world, and that does not seem to be the situation here. |
Beta Was this translation helpful? Give feedback.
1 reply
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.
Uh oh!
There was an error while loading. Please reload this page.
-
If there is a list view and a detail view, let's assume that id is needed for detail information in the detail view.
If so, does the id of the detail view belong to the state? Or does it belong to the environment?
I think this value is the environment, because regardless of the state of the detail view.
And this value just passed from list view. am I wrong?
I saw the example code here, but I couldn't figure it out because it was made up of a single view.
Beta Was this translation helpful? Give feedback.
All reactions