Skip to content
Discussion options

You must be logged in to vote

TL;DR: if you list something, like a list of recipes named recipes, and you can't use use the couple ForEachStore and recipeReducer.forEach(...) because you want to control the navigation with NavigationLink(destination:tag:selection:label:) what I named NavigationLink with selection:, you have to use the technique Identified selection:
State

struct RecipeListState: Equatable {
    var recipes: IdentifiedArrayOf<RecipeState>
    var selection: Identified<Recipe.ID, RecipeState>?
}

Action

enum RecipeListAction: Equatable {
    case setNavigation(selection: Recipe.ID?)
    case recipe(RecipeAction)
}

Reducer

let recipeListReducer = Reducer<RecipeListState, RecipeListAction, RecipeListEnviro…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@renaudjenny
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by renaudjenny
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant