I'm having a hard time using the Connectable protocol on a PassthroughSubject. What I would like to do is be able to control when the PassthroughSubject begins sending events to its subscribers.
let eventPublisher = PassthroughSubject<String, Never>().makeConnectable()
let subscriber = MySubscriber()
eventPublisher.subscribe(subscriber)
eventPublisher.send("Hello") // Does not compile, send not found in Publisher.MakeConnectable
let cancelable = eventPublisher.connect()
// expect MySubscriber to recieve "Hello"
I'm new to Combine, but I don't understand how I can send values downstream to subscribers after becoming a connectable publisher and calling connect(). The docs are quite sparse on this topic and I'm hoping someone can show me how to achive this behavior.