Contents

AnyCancellable

A type-erasing cancellable object that executes a provided closure when canceled.

Declaration

final class AnyCancellable

Mentioned in

Overview

Subscriber implementations can use this type to provide a “cancellation token” that makes it possible for a caller to cancel a publisher, but not to use the Subscription object to request items.

An AnyCancellable instance automatically calls cancel() when deinitialized.

Topics

Creating a type-erased cancellable

Storing instances

Operators

See Also

Publishers