Skip to content

Instantly share code, notes, and snippets.

@Otbivnoe
Created September 12, 2017 06:48
Show Gist options
  • Save Otbivnoe/272c3fa9ff77a3493e084e80099b24fa to your computer and use it in GitHub Desktop.
Save Otbivnoe/272c3fa9ff77a3493e084e80099b24fa to your computer and use it in GitHub Desktop.
let observable = Observable<Void>.create { observer -> Disposable in
// run request
observer.onCompleted()
return Disposables.create {
// request.cancel()
print("disposed ☠️")
}
}
let disposable = observable.subscribe()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment