/RxSwift_Trait_Single.swift Secret
Last active
April 28, 2022 09:32
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
Single<Int>.create { single in | |
single(.success(2)) | |
// 이후의 코드는 전달되지 않습니다. | |
// success는 completed를 호출한것과 같기 때문입니다. | |
// single(.success(3)) | |
return Disposables.create() | |
}.subscribe { | |
print("Single >>>", $0) | |
}.disposed(by: disposeBag) | |
// Single >>> 2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment