Skip to content

Commit

Permalink
Add task to any cancellable conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
neakor committed Oct 27, 2022
1 parent 8c86d79 commit 3c0d511
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Sources/IMVVM/Task+Interactor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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.
///
Expand Down

0 comments on commit 3c0d511

Please sign in to comment.