Created
June 29, 2018 10:05
-
-
Save bobgodwinx/de9589133ca45fbe88a63f4d3186ba06 to your computer and use it in GitHub Desktop.
OST07
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
/// `ViewModel` | |
class ViewModel: ViewModelType { | |
let source: Driver<UIImage?> | |
let finished: Completable | |
init(_ model: ModelType = Model()) { | |
self.source = model.datasource | |
.map { UIImage.gif(data: $0.data) } | |
.asDriver(onErrorJustReturn: nil) | |
self.finished = model.datasource | |
.observeOn(MainScheduler.asyncInstance) | |
.take(1) | |
.asCompletable() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment