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'),
    user:               createReducer(null, 'SET_USER'),
    msg:                createReducer(null, 'SET_MSG'),
    games:              createReducer([], 'SET_GAMES'),
};
