I know publisher has a method subscribe(_ subject: Subject)
let arrPublisher = [1,2,3,4].publisher
let tester = PassthroughSubject<Int, Never>()
arrPublisher.sink { result in
print(result)
}.store(in: &subscriptions)
arrPublisher.subscribe(tester)
tester.send(5)
why tester as a subject cant send data after publisher has subscribed it.
3 posts - 3 participants