Open nagarajvrao opened 4 years ago
Works fine without combine.
Is it because datataskpublisher returns anycancellable which calls cancel() when deinitialized. In our case, cancel() is called when control leaves fetchImage()
@nagarajvrao so, how to fix it? -.-😂
This is working for me
// Add anycancellable
private var subscription = Set<AnyCancellable>()
// Add .store(in: &Set<AnyCancellable>) after .sink
.sink(receiveValue: { [weak self] image in
self?.userImages[user] = image
}).store(in: &subscription)
Simulator ios version - 13.4