Replies: 1 comment
-
Hi @atacan, there are a lot of discussions about "sharing state" that you can find in here for techniques to do this. And very soon we will be releasing official tools for doing this. We will even give a sneak peek of the tools in our livestream tomorrow. 🤫 |
Beta Was this translation helpful? Give feedback.
0 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.
-
What's the best way to sync the state of a child based on the state of its sibling?
I thought it's not a good idea to look at the actions of the sibling in the parent and update the state of the child accordingly, because then we keep replicating the business logic of the sibling in two places.
I added an
onReceive
modifier to the child view where I used the Combine publisher of the sibling's state to change the child's state inside the parent reducer. Is there a better way?Example:
Parent has two independent children.
When the state of Child A's button becomes "enabled" then I want to make the state of Child B's text "Disabled".
Beta Was this translation helpful? Give feedback.
All reactions