Can someone please help me understand PassthroughSubject
and CurrentValueSubject
? What I understand so far is that they are subjects where subscribers can listen to changes made to these subjects, but I'm really straggling to understand the following.
I'm I correct by saying that PassthroughSubject
or CurrentValueSubject
could replace delegation
and asynchronous function calls?
Is it possible to delare a subject in Class A
and subscribe to listen to those subject changes in Class B
and in some other classes or are listeners meant to only be used direclty in SwiftUI structs?
Thanks