Skip to content

Commit

Permalink
Workaround SPM limitations
Browse files Browse the repository at this point in the history
  • Loading branch information
luizmb committed Jul 2, 2019
1 parent 5f8b486 commit 608d077
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Sources/Combine/PublisherType+Publisher.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Combine
import Foundation
import SwiftRex

@available(iOS 13, watchOS 6, macOS 10.15, tvOS 13, *)
extension PublisherType: Publisher {
public typealias Output = Element
public typealias Failure = ErrorType
Expand All @@ -23,6 +24,7 @@ extension PublisherType: Publisher {
}
}

@available(iOS 13, watchOS 6, macOS 10.15, tvOS 13, *)
extension Publisher {
public func asPublisherType() -> PublisherType<Output, Failure> {
return .init { (subscriber: SubscriberType<Output, Failure>) -> SwiftRex.Subscription in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Combine
import Foundation
import SwiftRex

@available(iOS 13, watchOS 6, macOS 10.15, tvOS 13, *)
extension ReplayLastSubjectType {
public init(currentValueSubject: CurrentValueSubject<Element, ErrorType>) {
self.init(
Expand Down
2 changes: 2 additions & 0 deletions Sources/Combine/SubjectType+PassthroughSubject.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Combine
import Foundation
import SwiftRex

@available(iOS 13, watchOS 6, macOS 10.15, tvOS 13, *)
extension SwiftRex.SubjectType {
public init(passthroughSubject: PassthroughSubject<Element, ErrorType>) {
self.init(
Expand All @@ -17,6 +18,7 @@ extension SwiftRex.SubjectType {
}
}

@available(iOS 13, watchOS 6, macOS 10.15, tvOS 13, *)
extension SwiftRex.SubjectType {
public static func combine() -> SwiftRex.SubjectType<Element, ErrorType> {
let passthroughSubject = PassthroughSubject<Element, ErrorType>()
Expand Down
2 changes: 2 additions & 0 deletions Sources/Combine/SubscriberType+Subscriber.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Combine
import Foundation
import SwiftRex

@available(iOS 13, watchOS 6, macOS 10.15, tvOS 13, *)
extension SubscriberType: Subscriber {
public var combineIdentifier: CombineIdentifier {
CombineIdentifier()
Expand All @@ -26,6 +27,7 @@ extension SubscriberType: Subscriber {
}
}

@available(iOS 13, watchOS 6, macOS 10.15, tvOS 13, *)
extension Subscriber {
public func asSubscriberType() -> SubscriberType<Self.Input, Self.Failure> {
return SubscriberType<Self.Input, Self.Failure>(
Expand Down
2 changes: 2 additions & 0 deletions Sources/Combine/Subscription+Cancellable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ import Combine
import Foundation
import SwiftRex

@available(iOS 13, watchOS 6, macOS 10.15, tvOS 13, *)
extension SwiftRex.Subscription {
public func asCancellable() -> CancellableSubscription {
return CancellableSubscription(subscription: self)
}
}

@available(iOS 13, watchOS 6, macOS 10.15, tvOS 13, *)
public class CancellableSubscription: Cancellable, SwiftRex.Subscription, Combine.Subscription {
public func request(_ demand: Subscribers.Demand) {
// No support for backpressure
Expand Down

0 comments on commit 608d077

Please sign in to comment.