Here's the scenario... Let's say you have any number of optional views where the user can download a file, some of the views more deeply nested than others, but they all share the same leaf view. When a download starts in any of these views, that work is sent to a 'downloadClient' in the global environment, all good so far. That downloadClient send actions back to the caller for progress and completion (like the TCA demo).
Now the user leaves one of these optional views, the download continues, but I lose updates and completion action. If I 'catch' these at the app level reducer, the actions are very deeply nested and I have to create a case statement for every single view, deeply nesting the action hierarchy. For example:
case let .homeView(.itemRecentsRow( .itemDetail(.item(id: id, action: .downloadComponent(.downloadClient( .success(.response(url)))))))): print("id: \(id) result: \(url)") return .none
Is there a simpler way that could be recommended?