Skip to content

Commit

Permalink
Remove Cancellable conformances.
Browse files Browse the repository at this point in the history
  • Loading branch information
andersio authored Apr 26, 2020
1 parent 4cffe30 commit dce8b0a
Showing 1 changed file with 2 additions and 24 deletions.
26 changes: 2 additions & 24 deletions Sources/CombineInteroperability/Utilities.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,7 @@ import Combine
extension Lifetime {
@available(macOS 10.15, iOS 13.0, tvOS 13.0, macCatalyst 13.0, watchOS 6.0, *)
@discardableResult
public static func += <C: Cancellable>(lhs: Lifetime, rhs: C) -> Disposable? {
lhs.observeEnded(rhs.cancel)
public static func += <C: Cancellable>(lhs: Lifetime, rhs: C?) -> Disposable? {
rhs.flatMap { lhs.observeEnded($0.cancel) }
}
}

@available(macOS 10.15, iOS 13.0, tvOS 13.0, macCatalyst 13.0, watchOS 6.0, *)
extension AnyDisposable: Cancellable {
public func cancel() {
dispose()
}
}

@available(macOS 10.15, iOS 13.0, tvOS 13.0, macCatalyst 13.0, watchOS 6.0, *)
extension SerialDisposable: Cancellable {
public func cancel() {
dispose()
}
}

@available(macOS 10.15, iOS 13.0, tvOS 13.0, macCatalyst 13.0, watchOS 6.0, *)
extension CompositeDisposable: Cancellable {
public func cancel() {
dispose()
}
}
#endif

0 comments on commit dce8b0a

Please sign in to comment.