본문 바로가기

반응형

개발/RxSwift

(10)
[RxSwift] bind, driver, relay GitHub - ReactiveX/RxSwift: Reactive Programming in Swift Reactive Programming in Swift. Contribute to ReactiveX/RxSwift development by creating an account on GitHub. github.com RxSwift 6.1 Bind Bind와 Driver 모두 메인 스케줄러에서 실행되며 에러 이벤트를 따로 방출하지 않는다. UI와 관련된 operator이며 UI와 Observable을 하나로 묶는다. 에러를 뱉지 않기 때문에 UI 핸들링으로 활용하는 것이 적합하다! bind를 사용하게 되면 아래와 같이 방출한 이벤트 그대로를 label의 텍스트와 bind 한다. Observable을 구독하..
[RxSwift] Mathematical & Aggregate, Connectable Observable Operators ReactiveX - Observable Observable In ReactiveX an observer subscribes to an Observable. Then that observer reacts to whatever item or sequence of items the Observable emits. This pattern facilitates concurrent operations because it does not need to block while waiting for the Ob reactivex.io Mathematical & Aggregate Operators 종류 Concat Reduce Concat 둘 이상의 Observable 을 끼워넣어 방출한다. Observable을 직렬로 ..
[RxSwift] Conditional & Boolean Operators ReactiveX - Operators Introduction Each language-specific implementation of ReactiveX implements a set of operators. Although there is much overlap between implementations, there are also some operators that are only implemented in certain implementations. Also, each implementa reactivex.io Conditional & Boolean Operators 종류 Amb Skip (skip:) Skip (while:) Take (Until:) Take (while:) Amb 두 개 이상의 ..
[RxSwift] Observable Utility Operators ReactiveX 한국어 runebook.dev Observable Utility Operators Delay Do Materialize / Dematerialize Timeout Using Serialize ObserveOn SubscribeOn Delay Observable을 특정 시간만큼 이동히여 방출을 늦춘다. Observable의 각 항목을 방출하기 전의 특정 시간 단위 동안 일시정지하여 Observable을 수정한다. Observable에 의해 방출된 항목의 전체 시퀀스를 지정된 증가만큼 앞으로 이동시키는 효과가 있다. Observable.of(1, 2, 3, 4) .delay(DispatchTimeInterval.seconds(3), scheduler: MainScheduler.instanc..
[RxSwift] Combining Observables & Error Handling Operators ReactiveX - Operators Introduction Each language-specific implementation of ReactiveX implements a set of operators. Although there is much overlap between implementations, there are also some operators that are only implemented in certain implementations. Also, each implementa reactivex.io Combine Observables CombineLatest (다중, 스트림 전부 항목이 있어야 활성화되며 가장 최근 방출한 값을 합침) SwitchLatest (하나의 스트림만 주목) Zi..
[RxSwift] Filtering Observable ReactiveX - Operators Introduction Each language-specific implementation of ReactiveX implements a set of operators. Although there is much overlap between implementations, there are also some operators that are only implemented in certain implementations. Also, each implementa reactivex.io Filtering Observable 이벤트들이 특정 조건이 맞을 때 발생하도록 이벤트를 필터링 하는 메서드다. Filtering Observable 종류 Debounce Distinct E..
[RxSwift] Transforming Observable Transforming Observable Operators Buffer GroupBy Map FlatMap Scan Window Buffer Observable을 지정된 크기만큼 담고 있다가 버퍼가 꽉 차면 가지고 있던 Observable을 배열로 내보내는 연산자다. 버퍼의 다양한 언어별 구현체에는 어떤 항목이 어떤 버퍼에 들어갈지 선택하는 방법에 따라 다양한 변형이 있다. Observable이 onError 알림을 실행하면 버퍼가 오류 알림을 실행하기 전에 소스 Observable에서 내보낸 항목을 포함하더라도 버퍼는 먼저 버퍼를 내보내지 않고 이 알림을 즉시 전달한다. Window 연산자는 Buffer과 유사하지만 항목을 다시 실행하기 전에 데이터 구조로 수집하지 않고 별도의 Observable로 ..
[RxSwift] Observable 생성 연산자 ReactiveX - Operators 연산자 소개 ReactiveX를 지원하는 언어 별 구현체들은 다양한 연산자들을 제공하는데, 이 중에는 공통적으로 제공되는 연산자도 있지만 반대로 특정 구현체에서만 제공하는 연산자들도 존재한다 reactivex.io Observable 연산자 Observable 생성 연산자 Create 직접적인 코드 구현을 통해 옵저버 메소드를 호출해 Observable을 생성한다 create는 Cancelable 프로토콜을 따르기 때문에 Disposable 형태를 반환해야한다. Observable .create { observable in observable.onNext(0) observable.onNext(1) observable.onNext(2) observable.onComp..

반응형