Last active
January 23, 2019 13:20
-
-
Save M0rtyMerr/18162b32c5f3efe57fccbe8ec416aa60 to your computer and use it in GitHub Desktop.
RxSwiftExt fromAsync. Rx frameworks can be found here - https://github.com/RxSwiftCommunity/RxGesture
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
// materialized + errors, elements | |
let checkinEvents = checkin | |
.flatMapLatest { [checkinService] in | |
checkinService.post(checkinRequest: $0).asObservable().materialize() | |
} | |
.share() | |
checkinEvents | |
.elements() | |
.bind(to: showSuccessScreen) | |
.disposed(by: disposeBag) | |
checkinEvents | |
.errors() | |
.map { _ in "Something went wrong" } | |
.bind(to: showError) | |
.disposed(by: disposeBag) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment