You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
finalclassViewModel{letnodes=CurrentValueSubject<[Int],Never>([])varcancel:AnyCancellable?init(){
cancel = nodes
.dropFirst().filter{
!$0.isEmpty
}.withLatestFrom(nodes).sink{[weak self] nodes in
guard let self else{return}print("nodes.count: \(nodes.count)")print("self.nodes.value.count: \(self.nodes.value.count)")
if nodes.count !=self.nodes.value.count {print("WTF")}}
nodes.send([1,2,3])}}
If you run it multiple times, it might print WTF. I've used the Rx framework for many years and I find this behavior quite strange. Is this normal or abnormal?
The text was updated successfully, but these errors were encountered:
finalclassViewModel{letnodes=CurrentValueSubject<[Int],Never>([])varcancel:AnyCancellable?init(){
cancel = nodes
.dropFirst().filter{
!$0.isEmpty
}.withLatestFrom(nodes).sink{[weak self] nodes in
guard let self else{return}print("nodes.count: \(nodes.count)")print("self.nodes.value.count: \(self.nodes.value.count)")
if nodes.count !=self.nodes.value.count {print("WTF")}}
nodes.send([1,2,3])}}
If you run it multiple times, it might print WTF. I've used the Rx framework for many years and I find this behavior quite strange. Is this normal or abnormal?
If you run it multiple times, it might print
WTF
. I've used the Rx framework for many years and I find this behavior quite strange. Is this normal or abnormal?The text was updated successfully, but these errors were encountered: