ES6 Plato on Github
Report Home
Summary Display
reducers/events.js
Maintainability
65.18
Lines of code
33
Difficulty
14.00
Estimated Errors
0.07
Function weight
By Complexity
By SLOC
// helpers import { GET_EVENTS_AT } from '../constants/ActionTypes'; // initialize the redux state const initialState = { // page: null, //list: [], } /** * The event state reducer handled by redux. THe reducer takes the current state and the action and returns the new state */ const events = (state = initialState, action) => { switch (action.type) { case GET_EVENTS_AT: { console.log("passed to the reducer for action GET_EVENT_AT"); state = { ...state, list: action.payload, } break; } default: break; } return state } export default events;