understandingCombine icon indicating copy to clipboard operation
understandingCombine copied to clipboard

Typo in code example

Open 0Dmitry opened this issue 4 years ago • 0 comments

In Subjects

var storage = Set<AnyCancellable>() let topSubject = PassthroughSubject<String,Never>() override func viewDidLoad() { super.viewDidLoad() let sub1 = PassthroughSubject<String,Never>() topSubject.subscribe(sub1) .store(in:&self.storage) sub1.sink { print("sub1", $0)} .store(in:&self.storage) let sub12 = PassthroughSubject<String,Never>() topSubject.subscribe(sub12) .store(in:&self.storage) sub1.sink { print("sub2", $0)} .store(in:&self.storage) }

You subscribe twice to sub1. And sub12 should probably be sub2

0Dmitry avatar Dec 10 '20 07:12 0Dmitry