Bind multiple cancellables to the lifetime of another object like your view controller.
Usage
Import Cancellor and subscribe your publishers inside an ownedCancellables block. When your view controller is dismissed any active subscriptions will get cancelled automatically.
Cancellor
Bind multiple cancellables to the lifetime of another object like your view controller.
Usage
Import Cancellor and subscribe your publishers inside an
ownedCancellables
block. When your view controller is dismissed any active subscriptions will get cancelled automatically.To tie a single subscription to the lifetime of another object use:
Import
Add the following dependency to your Package.swift file:
License
Cancellor is available under the MIT license. See the LICENSE file for more info.
Credits
Created by Marin Todorov.
📚 You can support me by checking out our Combine book: combinebook.com.
Inspired by Ash Furrow’s NSObject-rx.
Name by https://github.com/manmal.