Skip to content

Instantly share code, notes, and snippets.

@ytyubox
Created November 14, 2020 06:45
Show Gist options
  • Save ytyubox/5f945eccfd0cc6f02b17a2a8f4262b43 to your computer and use it in GitHub Desktop.
Save ytyubox/5f945eccfd0cc6f02b17a2a8f4262b43 to your computer and use it in GitHub Desktop.
import Combine
let anyCancellable = AnyCancellable(Function())
class Function: Cancellable {
var function: (() -> Void)? = nil
func cancel() {
function = nil
}
func callAsFunction() {
function?()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment