Created
November 4, 2019 03:46
-
-
Save fmo91/91132290e687284468857589381eb8c6 to your computer and use it in GitHub Desktop.
A handy extension to make AnyCancellable array more similar to RxSwift's DisposeBag.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Combine | |
extension AnyCancellable { | |
func add(to cancellables: inout [AnyCancellable]) { | |
cancellables.append(self) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment