v3.13.0
API alignment with Combine
PublishSubject<Element, Error>
has been renamed toPassthroughSubject<Element, Error>
.next(value)
,completed()
andfailed(error)
methods on theObserver
type have been renamed toreceive(value)
,receive(completion: .finished)
andreceive(completion: .failure(error))
respectively.next(value)
,completed()
andfailed(error)
methods on theSubject
type have been renamed tosend(value)
,send(completion: .finished)
andsend(completion: .failure(error))
respectively.shareReplay(limit:)
has been renamed toshare(limit:)
.sink(receiveCompletion:receiveValue:)
operator is added.
let didChange = PassthroughSubject<Void, Never>()
didChange.sink { (value) in
print(value)
}
didChange.sink(receiveCompletion: { (completion) in
print(completion)
}, receiveValue: { value in
print(value)
})
didChange.send()
didChange.send(completion: .finished)