I have to migrate an application from ReactiveCocoa 4 to ReactiveCocoa 5 (due to Swift 3 migration)
The old implementation uses some RACSubject instances for triggering (performOperationSubject.sendNext) an operation and for handling (didOperationSubject.subscribeNext) the result
internal class MyClass {
internal var performOperationSubject: RACSubject = RACSubject()
internal var didOperationSubject: RACSubject = RACSubject()
internal overide init() {
super.init()
self.performOperationSubject.subscribeNext { [weak self](_) in
guard let strongSelf = self else { return }
strongSelf.didOperationSubject.sendNext(result)
}
}
and when the MyClass instance is used
myClassInstance.didOperationSubject.subscribeNext { ... }
myClassInstance.performOperationSubject.sendNext(value)
Unfortunately the RACSubject is no more present in ReactiveCocoa 5 (ReactiveSwift)
How can I replace the RACSubject in this context?