Shared State with Presented Children in NavigationStackStore #2186
Unanswered
wyeth-shamp
asked this question in
Q&A
Replies: 1 comment 2 replies
-
Hi @wyeth-shamp, there is maybe just more API surface area we need to add to With the API as it is right now you would need to get the ID of the last child and then use that to subscript in: state.path[id: state.path.ids.last!] = … That's pretty annoying, and really more work should be done to avoid the unwrap. Stephen and I will discuss this use case more and see if there is something we should be doing, or perhaps another way of thinking about the problem. |
Beta Was this translation helpful? Give feedback.
2 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.
-
Hi new To TCA and so far it is a lot of fun. I do have one question I have not been able to figure out myself. If I have a parent that has an effect running like a timer that is mutating its own state, how would I propagate those changes to the child? For example I would want to display the running timer in the child and it should be synced with the parent. In the following code I am able to start the timer and show it and push a child on to the stack but the child's time is not updating. There used to be a parameter on path called presented where you could access the presented child state. but that has been removed. So how are we supposed to do something like this now? I am sure I am just missing the proper way as if this were not in a stack the state would be scoped and updated but now the parent view is not redrawn when it is not visible so the child value is not updated. Any help would be appreciated.
Beta Was this translation helpful? Give feedback.
All reactions