From 3c0d511bcb109cd2290ee0eb1e08643380a35432 Mon Sep 17 00:00:00 2001 From: Yi Wang Date: Wed, 26 Oct 2022 20:59:39 -0700 Subject: [PATCH] Add task to any cancellable conversion --- Sources/IMVVM/Task+Interactor.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Sources/IMVVM/Task+Interactor.swift b/Sources/IMVVM/Task+Interactor.swift index 589ee35..bb11c44 100644 --- a/Sources/IMVVM/Task+Interactor.swift +++ b/Sources/IMVVM/Task+Interactor.swift @@ -25,6 +25,12 @@ import Foundation extension Task: Cancellable {} +extension Task { + public var anyCancellable: AnyCancellable { + AnyCancellable(cancel) + } +} + extension Task { /// When the interactor deinits, the task is cancelled. ///