Last active
March 17, 2019 18:22
-
-
Save eroth/0e23c881c5a4458353a265ec7f1ef24c 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
let disposeBag = DisposeBag() | |
func doSomethingRx() -> Observable<String> { | |
return Observable.create { observer in | |
observer.onNext("We're using RxSwift!") | |
return Disposables.create() | |
} | |
} | |
doSomethingRx() | |
.subscribe(onNext: { result in | |
print("result: \(result)") | |
}) | |
.disposed(by: disposeBag) | |
// prints "result: We're using RxSwift!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment