Unlock This Episode
Our Free plan includes 1 subscriber-only episode of your choice, plus weekly updates from our newsletter.
Introduction
Brandon:
So, we think it’s pretty incredible how easy it is to add new features to an existing navigation stack. It only took about 3 steps: you add the feature’s domain to the Path
reducer, you add a scope to the Path
reducer’s body, and finally you add the view to the NavigationStackStore
’s destination closure.
And once you complete those few steps you get immediate and infinite introspection into everything that is happening in the feature when it is on the stack. This includes being able to traverse and aggregate data across the elements of the stack, and the ability to see every single action sent into the child feature.
Stephen: But, as amazing as this all seems, there are some serious problems lurking in the shadows, and they are reminiscent of what we experienced with our presentations APIs for sheets, popovers and covers.
One of the big problems we saw with those forms of navigation, and in particular the ifLet
operator, is that when the child feature was dismissed, its effects were not cancelled. That allowed effects to continue feeding data into the system even long after the child feature had gone away.
This problem also exists in our navigation stack, and the forEach
operator, so let’s see how it can happen and what it takes to fix it.
Subscribe to Point-Free
Access this episode, plus all past and future episodes when you become a subscriber.
Already a subscriber? Log in
References
Composable navigation beta GitHub discussion
Brandon Williams & Stephen Celis • Monday Feb 27, 2023In conjunction with the release of episode #224 we also released a beta preview of the navigation tools coming to the Composable Architecture.