Skip to content

Commit b01c81b

Browse files
committed
ReactiveSwift compatibility changes.
1 parent 782257a commit b01c81b

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

Examples/CaseStudies/SwiftUICaseStudies/00-RootView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ struct RootView: View {
7070
initialState: AnimationsState(circleCenter: CGPoint(x: 50, y: 50)),
7171
reducer: animationsReducer,
7272
environment: AnimationsEnvironment(
73-
mainQueue: DispatchQueue.main.eraseToAnyScheduler()
73+
mainQueue: QueueScheduler.main
7474
)
7575
)
7676
)

Examples/CaseStudies/SwiftUICaseStudies/01-GettingStarted-Animations.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import ComposableArchitecture
2+
import ReactiveSwift
23
import SwiftUI
34

45
private let readMe = """
@@ -30,7 +31,7 @@ enum AnimationsAction: Equatable {
3031
}
3132

3233
struct AnimationsEnvironment {
33-
var mainQueue: AnySchedulerOf<DispatchQueue>
34+
var mainQueue: DateScheduler
3435
}
3536

3637
let animationsReducer = Reducer<AnimationsState, AnimationsAction, AnimationsEnvironment> {
@@ -49,8 +50,7 @@ let animationsReducer = Reducer<AnimationsState, AnimationsAction, AnimationsEnv
4950
index == 0
5051
? Effect(value: .setColor(color))
5152
: Effect(value: .setColor(color))
52-
.delay(for: 1, scheduler: environment.mainQueue)
53-
.eraseToEffect()
53+
.delay(1, on: environment.mainQueue)
5454
}
5555
)
5656

@@ -121,7 +121,7 @@ struct AnimationsView_Previews: PreviewProvider {
121121
initialState: AnimationsState(circleCenter: CGPoint(x: 50, y: 50)),
122122
reducer: animationsReducer,
123123
environment: AnimationsEnvironment(
124-
mainQueue: DispatchQueue.main.eraseToAnyScheduler()
124+
mainQueue: QueueScheduler.main
125125
)
126126
)
127127
)
@@ -133,7 +133,7 @@ struct AnimationsView_Previews: PreviewProvider {
133133
initialState: AnimationsState(circleCenter: CGPoint(x: 50, y: 50)),
134134
reducer: animationsReducer,
135135
environment: AnimationsEnvironment(
136-
mainQueue: DispatchQueue.main.eraseToAnyScheduler()
136+
mainQueue: QueueScheduler.main
137137
)
138138
)
139139
)

Examples/CaseStudies/SwiftUICaseStudiesTests/01-GettingStarted-AnimationsTests.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
import Combine
1+
import ReactiveSwift
22
import ComposableArchitecture
33
import XCTest
44

55
@testable import SwiftUICaseStudies
66

77
class AnimationTests: XCTestCase {
8-
let scheduler = DispatchQueue.testScheduler
8+
let scheduler = TestScheduler()
99

1010
func testRainbow() {
1111
let store = TestStore(
1212
initialState: AnimationsState(),
1313
reducer: animationsReducer,
1414
environment: AnimationsEnvironment(
15-
mainQueue: self.scheduler.eraseToAnyScheduler()
15+
mainQueue: self.scheduler
1616
)
1717
)
1818

0 commit comments

Comments
 (0)