I can see that Subject.eraseToAnySubject()
returns the concrete Subject
type AnySubject
. I'm assuming this is using a type eraser pattern.
However, the apple docs provide almost no details: https://developer.apple.com/documentation/combine/passthroughsubject/3241547-erasetoanysubject
Can anyone explain how this works and where it should be used?
Also, would it be possible to use the some
keyword to avoid using AnySubject
?