Our app uses CoreData as its data store. I'm trying to keep the app state completely ignorant of its backing store, so mutating actions below the top level don't know about the DB.
I have a higher order reducer that looks at mutations that need to be persisted. My concern is that this approach creates fairly deeply nested case statements, and these add up, even when the same child view types are reused.
For example, to 'monitor' a file downloaded from one of our views:
case let .homeView(.episodeRow(
.episodeCards(id: episodeId, action:
.downloadComponent(.downloadClient(.success(.response(fileURL))))))):
print("Episode \(episodeId) file downloaded \(fileURL)")
I am curious about opinions on this approach. Alternatively, I can just one-shot load / save the full app state from the DB (this gets more complicated when we introduce iCloud syncing, but I understand that's a different set of complexities).
Thanks.