Files
goTorrent/torrent-project/src/store/reducer.js
deranjer 1904a6ec24 adding more fields to torrentlist, ul speed/dl speed
enter the commit message for your changes. Lines starting
2017-12-14 20:42:55 -05:00

40 lines
876 B
JavaScript

import * as actionTypes from './actions';
const initialState = {
buttonState: "default",
sorting: [],
selection: [],
filter: ["Status", ""],
columnName: "Status"
}
const reducer = (state = initialState, action) => {
switch(action.type){
case actionTypes.CHANGE_SELECTION:
console.log("Change Selection", action.selection)
return {
...state,
selection: action.selection,
};
case actionTypes.SORTLIST:
console.log("List Sort", action.sorting)
return state;
case actionTypes.CHANGE_FILTER:
return {
...state,
filter: action.filter
}
default:
return state;
};
console.log("no actiontypes found", action)
return state;
}
export default reducer;