Skip to content

Commit e9e27ce

Browse files
committed
Remove type alias for Xcode 12.5 compatibility (#371)
* Remove type alias * Fix a few warnings
1 parent bf5302c commit e9e27ce

File tree

4 files changed

+10
-14
lines changed

4 files changed

+10
-14
lines changed

Examples/CaseStudies/SwiftUICaseStudies/00-Core.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ struct RootEnvironment {
6969
var fetchNumber: () -> Effect<Int, Never>
7070
var mainQueue: DateScheduler
7171
var numberFact: (Int) -> Effect<String, NumbersApiError>
72-
var trivia: (Int) -> Effect<String, TriviaApiError>
7372
var userDidTakeScreenshot: Effect<Void, Never>
7473
var uuid: () -> UUID
7574
var webSocket: WebSocketClient
@@ -81,7 +80,6 @@ struct RootEnvironment {
8180
fetchNumber: liveFetchNumber,
8281
mainQueue: QueueScheduler.main,
8382
numberFact: liveNumberFact(for:),
84-
trivia: liveTrivia(for:),
8583
userDidTakeScreenshot: liveUserDidTakeScreenshot.producer,
8684
uuid: UUID.init,
8785
webSocket: .live
@@ -145,7 +143,7 @@ let rootReducer = Reducer<RootState, RootAction, RootEnvironment>.combine(
145143
.pullback(
146144
state: \.effectsCancellation,
147145
action: /RootAction.effectsCancellation,
148-
environment: { .init(mainQueue: $0.mainQueue, trivia: $0.trivia) }
146+
environment: { .init(mainQueue: $0.mainQueue, numberFact: $0.numberFact) }
149147
),
150148
episodesReducer
151149
.pullback(

Examples/CaseStudies/SwiftUICaseStudies/02-Effects-Cancellation.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ enum EffectsCancellationAction: Equatable {
2626
case cancelButtonTapped
2727
case stepperChanged(Int)
2828
case triviaButtonTapped
29-
case triviaResponse(Result<String, TriviaApiError>)
29+
case triviaResponse(Result<String, NumbersApiError>)
3030
}
3131

3232
struct TriviaApiError: Error, Equatable {}
3333

3434
struct EffectsCancellationEnvironment {
3535
var mainQueue: DateScheduler
36-
var trivia: (Int) -> Effect<String, TriviaApiError>
36+
var numberFact: (Int) -> Effect<String, NumbersApiError>
3737
}
3838

3939
// MARK: - Business logic
@@ -59,7 +59,7 @@ let effectsCancellationReducer = Reducer<
5959
state.currentTrivia = nil
6060
state.isTriviaRequestInFlight = true
6161

62-
return environment.trivia(state.count)
62+
return environment.numberFact(state.count)
6363
.observe(on: environment.mainQueue)
6464
.catchToEffect()
6565
.map(EffectsCancellationAction.triviaResponse)
@@ -129,7 +129,7 @@ struct EffectsCancellation_Previews: PreviewProvider {
129129
reducer: effectsCancellationReducer,
130130
environment: EffectsCancellationEnvironment(
131131
mainQueue: QueueScheduler.main,
132-
trivia: liveTrivia(for:)
132+
numberFact: liveNumberFact(for:)
133133
)
134134
)
135135
)

Examples/CaseStudies/SwiftUICaseStudiesTests/02-Effects-CancellationTests.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class EffectsCancellationTests: XCTestCase {
1313
reducer: effectsCancellationReducer,
1414
environment: .init(
1515
mainQueue: self.scheduler,
16-
trivia: { n in Effect(value: "\(n) is a good number Brent") }
16+
numberFact: { n in Effect(value: "\(n) is a good number Brent") }
1717
)
1818
)
1919

@@ -43,7 +43,7 @@ class EffectsCancellationTests: XCTestCase {
4343
reducer: effectsCancellationReducer,
4444
environment: .init(
4545
mainQueue: self.scheduler,
46-
trivia: { _ in Effect(error: TriviaApiError()) }
46+
numberFact: { _ in Effect(error: NumbersApiError()) }
4747
)
4848
)
4949

@@ -54,7 +54,7 @@ class EffectsCancellationTests: XCTestCase {
5454
.do {
5555
self.scheduler.advance()
5656
},
57-
.receive(.triviaResponse(.failure(TriviaApiError()))) {
57+
.receive(.triviaResponse(.failure(NumbersApiError()))) {
5858
$0.isTriviaRequestInFlight = false
5959
}
6060
)
@@ -72,7 +72,7 @@ class EffectsCancellationTests: XCTestCase {
7272
reducer: effectsCancellationReducer,
7373
environment: .init(
7474
mainQueue: self.scheduler,
75-
trivia: { n in Effect(value: "\(n) is a good number Brent") }
75+
numberFact: { n in Effect(value: "\(n) is a good number Brent") }
7676
)
7777
)
7878

@@ -95,7 +95,7 @@ class EffectsCancellationTests: XCTestCase {
9595
reducer: effectsCancellationReducer,
9696
environment: .init(
9797
mainQueue: self.scheduler,
98-
trivia: { n in Effect(value: "\(n) is a good number Brent") }
98+
numberFact: { n in Effect(value: "\(n) is a good number Brent") }
9999
)
100100
)
101101

Sources/ComposableArchitecture/SwiftUI/WithViewStore.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,6 @@
118118
/// from store state.
119119
@available(iOS 14, macOS 11, tvOS 14, watchOS 7, *)
120120
extension WithViewStore: Scene where Content: Scene {
121-
public typealias Body = Content
122-
123121
/// Initializes a structure that transforms a store into an observable view store in order to
124122
/// compute scenes from store state.
125123

0 commit comments

Comments
 (0)