nalexn / clean-architecture-swiftui

SwiftUI sample app using Clean Architecture. Examples of working with CoreData persistence, networking, dependency injection, unit testing, and more.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cancel() in CancelBag

opened this issue · comments

I noticed there's a method of cancel in CancelBag. When to use this method? (I can not find a case in your project)

Hey @golangnext , there is a button on the Country Details screen that allows you to cancel loading the data. That button actually triggers cancel on the CancelBag that keeps the running request alive.

oh, yes, we don't need to explicity call cancel method. An AnyCancellable instance automatically calls cancel() when deinitialized.