V8tr / SwiftCombineNetworking

Promise-Based Networking in Swift 5 with URLSession, Combine and Codable
https://www.vadimbulavin.com/
79 stars 17 forks source link

Chaining has extremely complex return value #3

Open teradyl opened 3 years ago

teradyl commented 3 years ago

Although this chaining example works, there's good reason to call sink OUTSIDE the function where we're chaining network calls. However, this requires the return value to be a complicated value that gets more complicated every time we had a chain to it. For example: Publishers.FlatMap<AnyPublisher<Void, Error>, AnyPublisher<API.MyApiResponse, Error>>

Do you know how this can be made simpler? Would love to see an example doing this.