function createReducer(defaultState, actionType) {
    return function reducer(state = defaultState, action) {
        switch (action.type) {
            case actionType:
                return action.value;
            default:
                return state;
        }
    };
}

/* eslint-disable key-spacing */
module.exports = {
    account:            createReducer(null, 'SET_ACCOUNT'),
    activeConstruct:    createReducer(null, 'SET_ACTIVE_CONSTRUCT'),
    activeItem:         createReducer(null, 'SET_ACTIVE_VAR'),
    activeSkill:        createReducer(null, 'SET_ACTIVE_SKILL'),
    combiner:           createReducer([null, null, null], 'SET_COMBINER'),
    constructs:         createReducer([], 'SET_CONSTRUCTS'),
    game:               createReducer(null, 'SET_GAME'),
    info:               createReducer(null, 'SET_INFO'),
    instance:           createReducer(null, 'SET_INSTANCE'),
    instances:          createReducer([], 'SET_INSTANCES'),
    itemEquip:          createReducer(null, 'SET_ITEM_EQUIP'),
    itemInfo:           createReducer({ combos: [], items: [] }, 'SET_ITEM_INFO'),
    itemUnequip:        createReducer(null, 'SET_ITEM_UNEQUIP'),
    nav:                createReducer(null, 'SET_NAV'),
    showNav:            createReducer(null, 'SET_SHOW_NAV'),
    ping:               createReducer(null, 'SET_PING'),
    player:             createReducer(null, 'SET_PLAYER'),
    reclaiming:         createReducer(false, 'SET_RECLAIMING'),
    resolution:         createReducer(null, 'SET_RESOLUTION'),
    showLog:            createReducer(false, 'SET_SHOW_LOG'),
    skip:               createReducer(false, 'SET_SKIP'),
    team:               createReducer([null, null, null], 'SET_SELECTED_CONSTRUCTS'),
    vboxHighlight:      createReducer([], 'SET_VBOX_HIGHLIGHT'),
    ws:                 createReducer(null, 'SET_WS'),
};
