Das ist mein reducrer:redux Aufruf Minderer mit Wirkung
export default function dashboardReducer(state=initialState.alerts, action){
switch(action.type){
case constActions.GET_ALERTS_SUCCESS:
return action.alerts;
case constActions.GET_WL_STATISTICS_SUCCESS:
return action.wlStatistics;
default:
return state;
}
};
Meine Wurzel Minderer:
function mapStateToProps(state, ownProps){
return{
alerts: state.dashboard
};
}
Jetzt habe ich:
const rootReducer = combineReducers({
dashboard
});
In der Komponente, das die mapStateToProps ist 2 Aktionen GET_ALERTS_SUCCESS
und GET_WL_STATISTICS_SUCCESS
. In der Komponente habe ich die Requisiten für actions.alerts
, aber wie kann ich einen Verweis auf action.wlStatistics
in der Komponente bekommen? Kann ich den Reducer mit einem Aktionstyp aufrufen?