Skip to content

Commit

Permalink
Remove Cancellable conformances.
Browse files Browse the repository at this point in the history
  • Loading branch information
andersio committed Apr 26, 2020
1 parent 4cffe30 commit d7b1a5d
Showing 1 changed file with 3 additions and 23 deletions.
26 changes: 3 additions & 23 deletions Sources/CombineInteroperability/Utilities.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,9 @@ 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)
}
}

@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()
public static func += <C: Cancellable>(lhs: Lifetime, rhs: C?) -> Disposable? {
rhs.flatMap { lhs.observeEnded($0.cancel) }
}
}
#endif

0 comments on commit d7b1a5d

Please sign in to comment.