Skip to content

Instantly share code, notes, and snippets.

@mihai8804858
Last active September 30, 2021 16:01
Show Gist options
  • Save mihai8804858/ae82c8d2ab06cdfc90df0c9c8f45b8a2 to your computer and use it in GitHub Desktop.
Save mihai8804858/ae82c8d2ab06cdfc90df0c9c8f45b8a2 to your computer and use it in GitHub Desktop.
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