Skip to content

Passing value from ChildView to ParentView #1115

Answered by ChaosCoder
oolxg asked this question in Q&A
Discussion options

You must be logged in to vote

The FilterState.tags can be accessed in the searchReducer via the state, that is passed: state.filterState.tags.

Btw.: the searchReducer should use the filterReducer via .pullback, e.g.

let searchReducer = Reducer<SearchState, SearchAction, ...>.combine {
    filterReducer.pullback(state: \.filterState, action: /SearchAction.filterAction, environment: { ... }),
    Reducer { state, action, _ in
       print(state.filterState.tags)
       return .none
    }
}

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by oolxg
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