일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 |
- @Environment
- nestjs
- IOS
- @Binding
- swift6
- SWIFT
- SwiftUI
- NullObject
- init?
- vim
- ios14
- NavigationLink
- Creating Operators
- operator
- nonisolated
- RxSwift
- URL(string:)
- init
- Operater
- @State
- Bug
- dismiss
- Operators
- typeorm
- graphql
- @EnvironmentObject
- RFC1738/1808
- RxCocoa
- Xcode
- subject
- Today
- Total
목록operator (16)
Tunko Development Diary

retry retry연산자는 옵저버블에서 에러가 발생하면 현재 시퀀스를 중단하고 다시 새로운 구독을 시작합니다. 새롭게 구독하는것이므로 기존에 있던 next이벤트들은 소멸되고 다시 시작합니다. retry 연산자 함수 원형 public func retry() -> Observable { CatchSequence(sources: InfiniteSequence(repeatedValue: self.asObservable())) } public func retry(_ maxAttemptCount: Int) -> Observable { CatchSequence(sources: Swift.repeatElement(self.asObservable(), count: maxAttemptCount)) } 함수 원형을 보시면..

share 이 연산자를 설명하기에 앞서 multicast, publish, replay, refCount 기능이 통합된 연산자라고 생각하시면 편하실것 같습니다. https://huniroom.tistory.com/entry/RxSwift-sharing-Subscription-Operator-multicast?category=1019140 RxSwift) sharing Subscription Operator (multicast, publish, replay) multicast multicast 연산자는 하나의 옵저버블을 공유할떄 사용하는 연산자입니다. 하지만 서브젝트를 따로 생성하고 이벤트가 방출되길 원하는 시점에 .connect() 를 호출해 주어야 합니다. 함수 원형 huniroom.tistory.co..

RefCount extension ConnectableObservableType { public func refCount() -> Observable { RefCount(source: self) } } RefCount 는 ConnectableObservableType 형에만 따로 구현되어있습니다. 구현된것을 보면 파라미터는 없고 Observable 을 리턴합니다. RefCount는 옵저버블입니다. 내부에 ConnectableObservable을 유지하면서 새로운 구독자가 생성되는 시점에 자동으로 connect() 시켜줍니다. let disposeBag = DisposeBag() let oneSecondObservable = Observable.interval(.seconds(1), scheduler: M..

multicast multicast 연산자는 하나의 옵저버블을 공유할떄 사용하는 연산자입니다. 하지만 서브젝트를 따로 생성하고 이벤트가 방출되길 원하는 시점에 .connect() 를 호출해 주어야 합니다. 함수 원형 public func multicast(_ subject: Subject) -> ConnectableObservable where Subject.Observer.Element == Element { ConnectableObservableAdapter(source: self.asObservable(), makeSubject: { subject }) } 멀티캐스트 연산자는 서브젝트를 전달받습니다. 원본 옵저버블에서 발생하는 이벤트는 구독자로 전달되는게 아니라 전달한 서브젝트로 이벤트가 전달됩니다..

delay delay연산자는 Next 이벤트의 전달을 지연시킵니다. Observable.interval(.seconds(1), scheduler: MainScheduler.instance) .take(10) .debug() .delay(.seconds(5), scheduler: MainScheduler.instance) .subscribe { print(Date(), $0)} .disposed(by: bag) 출력 2022-06-07 16:35:05.311: delay.playground:41 (__lldb_expr_36) -> subscribed 2022-06-07 16:35:06.314: delay.playground:41 (__lldb_expr_36) -> Event next(0) 2022-06-0..