Last active
September 30, 2021 16:01
-
-
Save mihai8804858/ae82c8d2ab06cdfc90df0c9c8f45b8a2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension Provider { | |
func requestEmpty<T: TargetType>(target: T) -> Observable<GravityResponse<Void>> { | |
requestData(target: target).then(decode) | |
} | |
private func decode(response: GravityResponse<Data>) -> Observable<GravityResponse<Void>> { | |
response.map { $0.map { _ in } } | |
.subscribe(on: ConcurrentDispatchQueueScheduler(qos: .utility)) | |
.observe(on: MainScheduler.instance) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment