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
I have been working on converting code from RxSwift to Swift Concurrency since last week and have successfully transitioned some parts. However, I am currently looking for a way to replace the distinctUntilChanged operator defined in RxSwift with an equivalent in Swift Concurrency.
Yesterday, I came across this library and am curious to know if it offers a suitable replacement for the distinctUntilChanged operator.
Could anyone advise how I might achieve this using this library? Any suggestions would be greatly appreciated.
For your reference, here is the code snippet where I'm using the distinctUntilChanged operator that I would like to replace:
// *The code below is just an example.
Observable.combineLatest(APIRequest1(),APIRequest2()).distinctUntilChanged{ old, new ->Boolinlet(oldResponse1Tuple, oldResponse2Tuple)= old
let(newResponse1Tuple, newResponse2Tuple)= new
letoldResponse1:[CustomType]= oldResponse1Tuple.0letoldResponse2:[CustomType]= oldResponse2Tuple.0letnewResponse1:[CustomType]= newResponse1Tuple.0letnewResponse2:[CustomType]= newResponse2Tuple.0return(oldResponse1 == newResponse1) && (oldResponse2 == newResponse2)}.subscribe(onNext:{[weak self]in
//...
}).disposed(by: disposeBag)
The text was updated successfully, but these errors were encountered:
Hello,
I have been working on converting code from RxSwift to Swift Concurrency since last week and have successfully transitioned some parts. However, I am currently looking for a way to replace the distinctUntilChanged operator defined in RxSwift with an equivalent in Swift Concurrency.
Yesterday, I came across this library and am curious to know if it offers a suitable replacement for the distinctUntilChanged operator.
Could anyone advise how I might achieve this using this library? Any suggestions would be greatly appreciated.
For your reference, here is the code snippet where I'm using the distinctUntilChanged operator that I would like to replace:
The text was updated successfully, but these errors were encountered: