Skip to content
Discussion options

You must be logged in to vote

SwitchStore expects you to explicitly switch over the initial state that is passed along:

-SwitchStore(store) { _ in
+SwitchStore(store) {
+  switch $0 {
+  case .content:
     CaseLet(
       state: /TestReducer.State.content,
       action: { (action: TestReducer.Action) in action }
     ) { store in
       Text("Content")
     }

+  case .other:
     CaseLet(
       state: /TestReducer.State.other,
       action: { (action: TestReducer.Action) in action }
     ) { store in
       Text("Other")
     }

+  case .nothing:
     CaseLet(
       state: /TestReducer.State.nothing,
       action: { (action: TestReducer.Action) in action }
     ) { store in
       Text("Nothing")
     }
+  }
 }

I…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@gsl-anthonymerle
Comment options

Answer selected by gsl-anthonymerle
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
Converted from issue

This discussion was converted from issue #2259 on July 04, 2023 22:37.