Last active
June 4, 2019 23:39
-
-
Save hermanbanken/72dac770041bfa1e27b4808ea31d2e47 to your computer and use it in GitHub Desktop.
Combine vs RxSwift
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
| Publishers.Future { (n: @escaping (Result<_, _>) -> Void) in | |
| Timer.init(timeInterval: 100, repeats: false) { (_) in | |
| n(.value(1)) | |
| } | |
| } |
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
| let observable: Observable<Int> = Observable.create { observer in | |
| Timer(timeInterval: 100, repeats: false) { (_) in | |
| observer.onNext(42) | |
| observer.onCompleted() | |
| } | |
| return Disposables.create() | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment