images.asObservable()
.subscribe(onNext: { [weak self] photos in
self?.updateUI(photos: photos)
})
.disposed(by: bag)
In this code images is originally a BehaviorRelay type, but we turn the type to an Observable. Can anyone explain why we don’t want to keep it as a BehaviorRelay or what are the risks if we don’t change it, functionally nothing looks different, so just curious why it matters.
(I know there’s a similar question, but the explanation doesn’t actually explain the why behind this decision.)