<commit_before>import {combineReducers} from 'redux';
const userConst = require('./const.json');

const idState = (() => {
    const initialState = {
        id: 'user-id-' + Math.random() + '-not-defined'
    };

    return (state = initialState, {type, payload}) => {
        if (type === userConst.type.setId) {
            return {
                ...state,
                id: payload.id
            };
        }

        return state;
    };
})();

const roomIdState = (() => {
    const initialState = {
        roomId: 'room-id-is-not-defined'
    };

    return (state = initialState, {type, payload}) => {
        if (type === userConst.type.setRoomId) {
            return {
                ...state,
                roomId: payload.roomId
            };
        }

        return state;
    };
})();

const publicIdState = (() => {
    const initialState = {
        publicId: 'public-id-is-not-defined'
    };

    return (state = initialState, {type, payload}) => {
        if (type === userConst.type.setPublicId) {
            return {
                ...state,
                publicId: payload.publicId
            };
        }

        return state;
    };
})();

export default combineReducers({
    idState,
    roomIdState,
    publicIdState
});<commit_msg>refactoring...<commit_after>import {combineReducers} from 'redux';
import createReducer from './../lib/create-reducer';
const userConst = require('./const.json');

export default combineReducers({
    idState: createReducer({id: 'user-id-' + Math.random() + '-not-defined'}, userConst.type.setId),
    roomIdState: createReducer({roomId: 'room-id-is-not-defined'}, userConst.type.setRoomId),
    publicIdState: createReducer({ publicId: 'public-id-is-not-defined'}, userConst.type.setPublicId)
});
{'fraction_non_alphanumeric': 0.15878378378378377, 'fraction_numerical': 0.0, 'mean_word_length': 2.0904347826086958, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '319094', 'n_tokens_mistral': 552, 'n_tokens_neox': 533, 'n_words': 104}