Why are Cancellables in Combine called Cancellables

I am learning combine and one of the thing that is holding me back is the confusion of the semantic meaning of Cancellables. Why are they called Cancellables. I have tried to search for this answer on google but I didn’t find sufficient answers to satisfy my curiosity. Also, what is the advantage of using combine bindings over computed properties in SwiftUI. Thanks

Answered by OOPer in 688073022

Why are they called Cancellables

I'm not sure what would satisfy your curiosity, Cancellable is a very common naming when you can cancel on it.


what is the advantage of using combine bindings over computed properties in SwiftUI.

Have you watched the WWDC session video when Combine was introduced?

Introducing Combine

So across the Cocoa SDK you'll find plenty of asynchronous interfaces. Some you saw here like Target/Action, but there's a lot more, including NotificationCenter and lots of ad-hoc callbacks. These are API's that take a closure or completion block. All of these things have important and different use cases. But sometimes when you need to compose them together, it can be a little bit challenging.

Using Combine, you can handle all the asynchronous data/event sources in a unified manner.

That can be a big advantage for developers struggling to compose such different kinds of asynchronous sources.

If you do not feel it an advantage, it may be better for you to stay on the ways like computed property.

Accepted Answer

Why are they called Cancellables

I'm not sure what would satisfy your curiosity, Cancellable is a very common naming when you can cancel on it.


what is the advantage of using combine bindings over computed properties in SwiftUI.

Have you watched the WWDC session video when Combine was introduced?

Introducing Combine

So across the Cocoa SDK you'll find plenty of asynchronous interfaces. Some you saw here like Target/Action, but there's a lot more, including NotificationCenter and lots of ad-hoc callbacks. These are API's that take a closure or completion block. All of these things have important and different use cases. But sometimes when you need to compose them together, it can be a little bit challenging.

Using Combine, you can handle all the asynchronous data/event sources in a unified manner.

That can be a big advantage for developers struggling to compose such different kinds of asynchronous sources.

If you do not feel it an advantage, it may be better for you to stay on the ways like computed property.

Why are Cancellables in Combine called Cancellables
 
 
Q