child
fun <ParentState, ParentAction : Any, ChildState> child(reducer: Reducer<ChildState, ParentAction>, mapToChildState: (parent: ParentState) -> ChildState): ChildReducer<ParentState, ParentAction, ChildState>
Transforms the Reducer to a ChildReducer for combineReducers. The mapToChildState transforms the ParentState to the ChildState.
fun <ParentState, ParentAction : Any, ChildState, ChildAction : Any> child(reducer: Reducer<ChildState, ChildAction>, mapToChildAction: (parent: ParentAction) -> ChildAction?, mapToChildState: (parent: ParentState) -> ChildState): ChildReducer<ParentState, ParentAction, ChildState>
Transforms the Reducer to a ChildReducer for combineReducers. The mapToChildAction transforms the ParentAction to the ChildAction, and the mapToChildState transforms the ParentState to the ChildState. If the mapToChildAction returns null
, the reducer will not be called.