Skip to content

Commit

Permalink
CombineExt 1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
freak4pc committed Apr 10, 2020
1 parent 36b8db5 commit 7ed4677
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CombineExt.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "CombineExt"
s.version = "1.0.0"
s.version = "1.1.0"
s.summary = "Combine operators and helpers not provided by Apple, and inspired by other Reactive Frameworks"
s.description = <<-DESC
A collection of operators for Combine adding capabilities and utilities not provided by Apple,
Expand Down
3 changes: 1 addition & 2 deletions Sources/Operators/Amb.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ public extension Publisher {
/// - returns: A publisher which mirrors the first publisher to emit an event
func amb<Other: Publisher>(with others: Other...)
-> AnyPublisher<Self.Output, Self.Failure> where Other.Output == Output, Other.Failure == Failure {
let never = Empty<Output, Failure>(completeImmediately: false).eraseToAnyPublisher()
return others.reduce(never) { result, current in
others.reduce(self.eraseToAnyPublisher()) { result, current in
result.amb(current).eraseToAnyPublisher()
}
}
Expand Down
4 changes: 2 additions & 2 deletions Tests/AmbTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ class AmbTests: XCTestCase {
var valuesThree = [Int]()
var valuesFour = [Int]()

subject1
.amb(with: subject2, subject3, subject4)
subject4
.amb(with: subject2, subject3, subject1)
.sink(receiveCompletion: { completionFour = $0 },
receiveValue: { valuesFour.append($0) })
.store(in: &subscriptions)
Expand Down

0 comments on commit 7ed4677

Please sign in to comment.