DistinctUntilChanged
연달아 같은 값이 오면 생략한다.
Observable.of(1, 2, 2, 1, 3)
.distinctUntilChanged()
.subscribe(onNext: {
print($0)
})
.disposed(by: disposeBag)
/* Prints :
1
2
1
3
/*
'IOS🍎 > RxSwift' 카테고리의 다른 글
[RxSwift] Transforming Operator (map, flatMap, scan, reduce) (0) | 2022.05.16 |
---|---|
[RxSwift] Error Handling Operator (0) | 2022.05.10 |
[RxSwift] Schedular란 (subscribeOn, observeOn) (0) | 2022.04.29 |
[RxSwift] Signal, ControlProperty, ControlEvent 란 ? (0) | 2022.03.21 |
[RxSwift] Driver란 ? (feat. bind) (0) | 2022.03.21 |
댓글