Skip to content

Commit 32c8034

Browse files
committed
Rename stream from updates to configUpdates to better align with the naming scheme
1 parent e1088fe commit 32c8034

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

FirebaseRemoteConfig/Swift/RemoteConfig+Async.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public extension RemoteConfig {
3535
/// func listenForRealtimeUpdates() {
3636
/// Task {
3737
/// do {
38-
/// for try await configUpdate in remoteConfig.updates {
38+
/// for try await configUpdate in remoteConfig.configUpdates {
3939
/// print("Updated keys: \(configUpdate.updatedKeys)")
4040
/// // Activate the new config to make it available
4141
/// let status = try await remoteConfig.activate()
@@ -47,8 +47,8 @@ public extension RemoteConfig {
4747
/// }
4848
/// }
4949
/// ```
50-
var updates: AsyncThrowingStream<RemoteConfigUpdate, Error> {
51-
return AsyncThrowingStream { continuation in
50+
var configUpdates: AsyncThrowingStream<RemoteConfigUpdate, Error> {
51+
AsyncThrowingStream { continuation in
5252
let listener = addOnConfigUpdateListener { update, error in
5353
switch (update, error) {
5454
case let (update?, _):

FirebaseRemoteConfig/Tests/Swift/SwiftAPI/AsyncStreamTests.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class MockListenerRegistration: ConfigUpdateListenerRegistration, @unchecked Sen
3333
/// A mock for the RCNConfigRealtime component that allows tests to control the config update
3434
/// listener.
3535
class MockRealtime: RCNConfigRealtime, @unchecked Sendable {
36-
/// The listener closure captured from the `updates` async stream.
36+
/// The listener closure captured from the `configUpdates` async stream.
3737
var listener: ((RemoteConfigUpdate?, Error?) -> Void)?
3838
let mockRegistration = MockListenerRegistration()
3939
var listenerAttachedExpectation: XCTestExpectation?
@@ -62,7 +62,7 @@ class MockRealtime: RCNConfigRealtime, @unchecked Sendable {
6262
}
6363
}
6464

65-
// MARK: - AsyncStreamTests2
65+
// MARK: - AsyncStreamTests
6666

6767
@available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *)
6868
class AsyncStreamTests: XCTestCase {
@@ -107,7 +107,7 @@ class AsyncStreamTests: XCTestCase {
107107
mockRealtime.listenerAttachedExpectation = listenerAttachedExpectation
108108

109109
let listeningTask = Task {
110-
for try await update in config.updates {
110+
for try await update in config.configUpdates {
111111
XCTAssertEqual(update.updatedKeys, Set(keysToUpdate))
112112
expectation.fulfill()
113113
break // End the loop after receiving the expected update.
@@ -132,7 +132,7 @@ class AsyncStreamTests: XCTestCase {
132132

133133
let listeningTask = Task {
134134
do {
135-
for try await _ in config.updates {
135+
for try await _ in config.configUpdates {
136136
XCTFail("Stream should not have yielded any updates.")
137137
}
138138
} catch {
@@ -155,7 +155,7 @@ class AsyncStreamTests: XCTestCase {
155155
mockRealtime.listenerAttachedExpectation = listenerAttachedExpectation
156156

157157
let listeningTask = Task {
158-
for try await _ in config.updates {
158+
for try await _ in config.configUpdates {
159159
// We will cancel the task, so it should not reach here.
160160
}
161161
}
@@ -185,7 +185,7 @@ class AsyncStreamTests: XCTestCase {
185185
let listeningTask = Task {
186186
var updateCount = 0
187187
do {
188-
for try await _ in config.updates {
188+
for try await _ in config.configUpdates {
189189
updateCount += 1
190190
}
191191
// The loop finished without throwing, which is the success condition.
@@ -217,7 +217,7 @@ class AsyncStreamTests: XCTestCase {
217217
mockRealtime.listenerAttachedExpectation = listenerAttachedExpectation
218218

219219
let listeningTask = Task {
220-
for try await update in config.updates {
220+
for try await update in config.configUpdates {
221221
receivedUpdates.append(update.updatedKeys)
222222
expectation.fulfill()
223223
if receivedUpdates.count == updatesToSend.count {

0 commit comments

Comments
 (0)