BottleRocketStudios / iOS-Hyperspace

An extremely lightweight wrapper around URLSession to make working with APIs a breeze.
Apache License 2.0
47 stars 17 forks source link

Added `execute()` method that accepts a request that's `Recoverable` to `BackendServiceProtocol`. #109

Closed tylermilner closed 4 years ago

wmcginty commented 4 years ago

Haha, I literally made a branch that did this almost exact thing the other day (I've been making sure it works before creating a PR). I think the only additional things I did were add an requestRecoveryStrategy: RequestRecoveryStrategy? to BackendServiceProtocol and provide a convenience converter to a Future<Response, Error>

tylermilner commented 4 years ago

It sounds like your approach might be more complete than what I've got here, @wmcginty. I'm fine if we want to use your implementation. Would you say your branch is good to go? If so, I'll close this and point my app to your branch for the time being. Unfortunately, this is something I need ASAP so that I can finish up a feature to recover from 401 errors and ship today.

wmcginty commented 4 years ago

It fixed my issue - I'll throw up a PR now and you can take a look. Happy to merge quickly if you need.

tylermilner commented 4 years ago

Closing...these changes will be implemented as part of #110.