Skip to content

v3.13.0

Compare
Choose a tag to compare
@srdanrasic srdanrasic released this 22 Jun 08:02
· 126 commits to master since this release

API alignment with Combine

  • PublishSubject<Element, Error> has been renamed to PassthroughSubject<Element, Error>.
  • next(value), completed() and failed(error) methods on the Observer type have been renamed to receive(value), receive(completion: .finished) and receive(completion: .failure(error)) respectively.
  • next(value), completed() and failed(error) methods on the Subject type have been renamed to send(value), send(completion: .finished) and send(completion: .failure(error)) respectively.
  • shareReplay(limit:) has been renamed to share(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)