Created
November 8, 2016 15:00
-
-
Save darrensapalo/4f730555d55c46ed1070a911a30fc2da to your computer and use it in GitHub Desktop.
Sequential observables
This file contains hidden or 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
| ObstetricBabyManager | |
| .getAll() | |
| .doOnNext { baby in | |
| baby.Name = "John Smith" | |
| } | |
| .observeOn(ConcurrentDispatchQueueScheduler.init(queue: AsyncTaskUtil.backgroundThread)) | |
| .subscribeOn(MainScheduler.instance) | |
| .flatMap { baby in | |
| return ObstetricBabyManager.persist(baby) | |
| } | |
| .subscribe ( | |
| onNext: | |
| { | |
| print ($0.Name) | |
| }, | |
| onError: { error in | |
| print (error) | |
| } | |
| ) | |
| .addDisposableTo(garbageBag) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment