Skip to content

Commit 009c721

Browse files
committed
Change `groupBy(_:) to group(by:)
1 parent 96e7e4f commit 009c721

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Sources/SignalProducer.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1890,7 +1890,7 @@ extension SignalProducerProtocol {
18901890
/// - returns: A producer of producers amits one producer for each group and forwards
18911891
/// each value from the original producer to the inner producer corresponding
18921892
/// to the group to which the value belongs to (as determined by the key)
1893-
public func groupBy<Key: Hashable>(_ grouping: @escaping (Value) -> Key) -> SignalProducer<(Key, SignalProducer<Value, Error>), Error> {
1893+
public func group<Key: Hashable>(by grouping: @escaping (Value) -> Key) -> SignalProducer<(Key, SignalProducer<Value, Error>), Error> {
18941894
return SignalProducer<(Key, SignalProducer<Value, Error>), Error> { observer, disposable in
18951895
let groups = Atomic<[Key: Signal<Value, Error>.Observer]>([:])
18961896

Tests/ReactiveSwiftTests/SignalProducerLiftingSpec.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1674,7 +1674,7 @@ class SignalProducerLiftingSpec: QuickSpec {
16741674
var evens: [Int] = []
16751675
var odds: [Int] = []
16761676
let disposable = producer
1677-
.groupBy { $0 % 2 == 0 }
1677+
.group { $0 % 2 == 0 }
16781678
.startWithValues { key, group in
16791679
if key {
16801680
group.startWithValues { evens.append($0)}
@@ -1711,7 +1711,7 @@ class SignalProducerLiftingSpec: QuickSpec {
17111711
var oddsInterrupted = false
17121712

17131713
let disposable = producer
1714-
.groupBy { $0 % 2 == 0 }
1714+
.group { $0 % 2 == 0 }
17151715
.start { event in
17161716
switch event {
17171717
case let .value(key, group):
@@ -1750,7 +1750,7 @@ class SignalProducerLiftingSpec: QuickSpec {
17501750
var oddsInterrupted = false
17511751

17521752
producer
1753-
.groupBy { $0 % 2 == 0 }
1753+
.group { $0 % 2 == 0 }
17541754
.start { event in
17551755
switch event {
17561756
case let .value(key, group):
@@ -1787,7 +1787,7 @@ class SignalProducerLiftingSpec: QuickSpec {
17871787
var oddCompleted = false
17881788

17891789
producer
1790-
.groupBy { $0 % 2 == 0 }
1790+
.group { $0 % 2 == 0 }
17911791
.start { event in
17921792
switch event {
17931793
case let .value(key, group):
@@ -1825,7 +1825,7 @@ class SignalProducerLiftingSpec: QuickSpec {
18251825
var oddsError: TestError? = nil
18261826

18271827
producer
1828-
.groupBy { $0 % 2 == 0 }
1828+
.group { $0 % 2 == 0 }
18291829
.start { event in
18301830
switch event {
18311831
case let .value(key, group):

0 commit comments

Comments
 (0)