I would like to be able to run a block of code no matter what the outcome of the publishing chain is. Is there something similar in Combine + Swift?
Something like this:
func doSomeLongRunningTask() -> AnyPublisher<Void, Error> {
return Future<Void, Error> {
showSpinner()
}.tryMap {
longRunningTaskCanThrowError()
}.ensure {
hideSpinner()
}.eraseToAnyPublisher()
}