Skip to content

Commit 7ed4677

Browse files
committed
CombineExt 1.1.0
1 parent 36b8db5 commit 7ed4677

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

CombineExt.podspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "CombineExt"
3-
s.version = "1.0.0"
3+
s.version = "1.1.0"
44
s.summary = "Combine operators and helpers not provided by Apple, and inspired by other Reactive Frameworks"
55
s.description = <<-DESC
66
A collection of operators for Combine adding capabilities and utilities not provided by Apple,

Sources/Operators/Amb.swift

+1-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ public extension Publisher {
2626
/// - returns: A publisher which mirrors the first publisher to emit an event
2727
func amb<Other: Publisher>(with others: Other...)
2828
-> AnyPublisher<Self.Output, Self.Failure> where Other.Output == Output, Other.Failure == Failure {
29-
let never = Empty<Output, Failure>(completeImmediately: false).eraseToAnyPublisher()
30-
return others.reduce(never) { result, current in
29+
others.reduce(self.eraseToAnyPublisher()) { result, current in
3130
result.amb(current).eraseToAnyPublisher()
3231
}
3332
}

Tests/AmbTests.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,8 @@ class AmbTests: XCTestCase {
139139
var valuesThree = [Int]()
140140
var valuesFour = [Int]()
141141

142-
subject1
143-
.amb(with: subject2, subject3, subject4)
142+
subject4
143+
.amb(with: subject2, subject3, subject1)
144144
.sink(receiveCompletion: { completionFour = $0 },
145145
receiveValue: { valuesFour.append($0) })
146146
.store(in: &subscriptions)

0 commit comments

Comments
 (0)