diff --git a/Rx.playground/Pages/Filtering_and_Conditional_Operators.xcplaygroundpage/Contents.swift b/Rx.playground/Pages/Filtering_and_Conditional_Operators.xcplaygroundpage/Contents.swift index 064b5028..c885603a 100644 --- a/Rx.playground/Pages/Filtering_and_Conditional_Operators.xcplaygroundpage/Contents.swift +++ b/Rx.playground/Pages/Filtering_and_Conditional_Operators.xcplaygroundpage/Contents.swift @@ -73,6 +73,16 @@ example("single") { example("single with conditions") { let disposeBag = DisposeBag() + Observable.of("🐱", "🐰", "🐶", "🐸", "🐷", "🐵") + .single { $0 == "🐸" } + .subscribe { print($0) } + .addDisposableTo(disposeBag) + + Observable.of("🐱", "🐰", "🐶", "🐱", "🐰", "🐶") + .single { $0 == "🐰" } + .subscribe { print($0) } + .addDisposableTo(disposeBag) + Observable.of("🐱", "🐰", "🐶", "🐸", "🐷", "🐵") .single { $0 == "🔵" } .subscribe { print($0) }