Skip to content

Commit

Permalink
Fix deprecations in example project
Browse files Browse the repository at this point in the history
  • Loading branch information
johnpatrickmorgan committed Feb 15, 2023
1 parent eedba12 commit 9baa567
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ struct FinalScreen: ReducerProtocol {
}

let mainQueue: AnySchedulerOf<DispatchQueue>
let submit: (APIModel) -> Effect<Bool, Never>
let submit: (APIModel) -> EffectTask<Bool>

var body: some ReducerProtocol<State, Action> {
Reduce { state, action in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import Foundation

struct FormScreenEnvironment {
let mainQueue: AnySchedulerOf<DispatchQueue>
let getOccupations: () -> Effect<[String], Never>
let submit: (APIModel) -> Effect<Bool, Never>
let getOccupations: () -> EffectTask<[String]>
let submit: (APIModel) -> EffectTask<Bool>

static let test = FormScreenEnvironment(
mainQueue: .main,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import SwiftUI

struct Step1: ReducerProtocol {
public struct State: Equatable {
@BindableState var firstName: String = ""
@BindableState var lastName: String = ""
@BindingState var firstName: String = ""
@BindingState var lastName: String = ""
}

public enum Action: Equatable, BindableAction {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ struct Step2View: View {

struct Step2: ReducerProtocol {
public struct State: Equatable {
@BindableState var dateOfBirth: Date = .now
@BindingState var dateOfBirth: Date = .now
}

public enum Action: Equatable, BindableAction {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ struct Step3: ReducerProtocol {
}

let mainQueue: AnySchedulerOf<DispatchQueue>
let getOccupations: () -> Effect<[String], Never>
let getOccupations: () -> EffectTask<[String]>

var body: some ReducerProtocol<State, Action> {
Reduce { state, action in
Expand Down
2 changes: 1 addition & 1 deletion TCACoordinatorsExample/TCACoordinatorsExample/Screen.swift
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ struct NumberDetail: ReducerProtocol {
return .none

case .incrementAfterDelayTapped:
return Effect(value: NumberDetail.Action.incrementTapped)
return EffectTask(value: NumberDetail.Action.incrementTapped)
.delay(for: 3.0, tolerance: nil, scheduler: DispatchQueue.main, options: nil)
.eraseToEffect()

Expand Down

0 comments on commit 9baa567

Please sign in to comment.