Publisher that lives app lifecycle #1886
Unanswered
chrismiss1
asked this question in
Q&A
Replies: 1 comment 7 replies
-
Hey @chrismiss1! Try to make your long-living effect cancellable. You can check the "Long-living Effect" case study for more informations. |
Beta Was this translation helpful? Give feedback.
7 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.
-
I saw another similar question and maybe I'm a little dense right now but I still cannot seem to wrap my head around this problem over the last 4-5 days. At its root, my app has a HomeView which is a TabView with various tabs. Almost all of the views in the various tabs share this one piece of data; an array of a custom type, lets say, [SomeType]. For that reason, I've modeled the App.State to hold onto that piece of data and scope it into the child views where necessary. I have a publisher that publishes any time the backend updates [SomeType]. I am getting publishes as expected. In my reducer I always get the first publish, but never any subsequent publishes. I am architecting something wrong and probably misunderstanding something but how can I catch the subsequent publishes and continuously map the new data? On my HomeView, I have:
And in the reducer protocol:
So the
updateData
action is called on app launch but never again even though my publisher is publishing repeatedly with updates.Thanks for any hints in advance. If there is an episode, blog or something where this is answered in detail please point me to it!
Beta Was this translation helpful? Give feedback.
All reactions