标签:str 条件 until not takewhile 通知 除了 其他 image
let subject191 = PublishSubject<Int>()
let subject192 = PublishSubject<Int>()
let subject193 = PublishSubject<Int>()
subject191
.amb(subject192)
.amb(subject193)
.subscribe(onNext: { print($0) })
.disposed(by: bag)
subject192.onNext(0)
subject191.onNext(50)
subject192.onNext(1)
subject193.onNext(101)
subject193.onNext(102)
subject191.onNext(51)
subject192.onNext(2)
subject193.onNext(103)
Observable.of(1,2,3,4,6,1,3,8,3,5,9)
.takeWhile {
$0 < 7
}
.subscribe(onNext: { print($0) })
.disposed(by: bag)
let source21 = PublishSubject<String>()
let notifier21 = PublishSubject<String>()
source21.takeUntil(notifier21)
.subscribe(onNext: { print($0) })
.disposed(by: bag)
source21.onNext("a")
source21.onNext("b")
source21.onNext("c")
notifier21.onNext("A")
source21.onNext("d")
source21.onNext("e")
source21.onNext("f")
Observable.of(1,2,3,4,5,6,7)
.skipWhile{ $0 < 4 }
.subscribe(onNext: { print($0) })
.disposed(by: bag)
let source32 = PublishSubject<Int>()
let notifier32 = PublishSubject<Int>()
source32.skipUntil(notifier32)
.subscribe(onNext: { print($0) })
.disposed(by: bag)
source32.onNext(1)
source32.onNext(2)
source32.onNext(3)
notifier32.onNext(11)
source32.onNext(4)
source32.onNext(5)
notifier32.onNext(12)
source32.onNext(6)
source32.onNext(7)
标签:str 条件 until not takewhile 通知 除了 其他 image
原文地址:https://www.cnblogs.com/gchlcc/p/11847862.html