Skip to content
Discussion options

You must be logged in to vote

Hi @ylorn, since Swift 5.6.1 doesn't support primary associated types you must structure the body like this:

struct Demo: ReducerProtocol {
  struct State {
    var value: String
  }
  enum Action {
    case task
  }

  var body: Reduce<State, Action> {
    Reduce { state, action in
      switch action {
      case .task:
        return .none
      }
    }
  }
}

We have more information in our ReducerProtocol migration guide, in particular the section on Swift 5.6.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@mbrandonw
Comment options

@ylorn
Comment options

Answer selected by ylorn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants