Closed workingDog closed 4 years ago
Looks like a duplicate of #1.
Hi @workingDog, I think you are not retaining the subscription. For the purpose of example, I enforce its lifetime like this https://github.com/V8tr/SwiftCombineNetworking/blob/master/CombineNetworkLayer/main.swift#L27.
@mgcrea thanks for pointing out, it also looks like a duplicate of #1 to me.
You can also use .store(in: &subscriptions)
after a sink()
with var subscriptions = Set<AnyCancellable>()
to retain the cancellable.
I could not make this work at all. I keep getting this error:
finished with error [-999] Error Domain=NSURLErrorDomain Code=-999 "cancelled" UserInfo={NSErrorFailingURLStringKey=https://api.github.com/users/..../repos, NSLocalizedDescription=cancelled, NSErrorFailingURLKey=https://api.github.com/users/..../repos}