concise [weak self]
Here’s the code if you want to experiment with it:
publisher.sink { [weak self] newValue in
guard let self else { return }
self.doSomething(with: newValue)
}.store(in: &cancellables)
Here’s the code if you want to experiment with it:
publisher.sink { [weak self] newValue in
guard let self else { return }
self.doSomething(with: newValue)
}.store(in: &cancellables)