Alternative for BehaviorRelay in Swift Combine

Viewed 406

As part of moving from RX to Combine. What exactly works like "BehaviorRelay" of RxRelay in Swift Combine?

1 Answers

As mentioned in this Cheat Sheet, an RxSwift BehaviorSubject is the same as the Combine CurrentValueSubject. A BehaviorRelay is a simple wrapper around a BehaviorSubject and could easily be recreated in Combine, but doesn't exist natively.

Related