Best way to structure nested deinitializer
actions
#862
Unanswered
PeterKaminski09
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
My state is modeled like so:
HomeScreenList > Detail Screen > Component
I also have deinitializers set up such that:
ComponentAction.deinitialize
> cancels a long running effect specific to a ComponentDetailScreenAction.deinitialize
> cancels a long running effect specific to the entire Details ScreenHomeScreenListAction.popSelectedItem
> because the details screen is presented from a NavigationLink, the reducer handles calls to pop the selected itemUnfortunately, I am running into the dreaded
To my knowledge, this means that my home screen reducer will now get tightly coupled to
ComponentState
as I need to deinitialize the components from the bottom up.This seems to be caused by
Effect.concatenate
adding effects to a FIFO queue in the store, but what I'd really need is a LIFO stack to uncouple the deinitialization so that effects can be run starting with the bottom most subcomponent moving upwards to the HomeScreenListStateWas just curious if others have found a more elegant way to do this. It's also worth noting I have not had much chance to dig into recent updates to TCA since the 0.16.0 update, so this might have already been solved.
Beta Was this translation helpful? Give feedback.
All reactions