<commit_before>import { combineReducers } from 'redux';
import {
	TOGGLE_EDIT_ITEM,
	GET_COLUMNS
} from '../actions/boardColumn';

let initState = {
	columnEdit: {},
	columns: []
};

function columnEdit(state = initState.columnEdit, action) {
	switch(action.type) {
		case TOGGLE_EDIT_ITEM:
			return {
				...state,
				[action.payload.id]: action.payload.item
			};
		default:
			return state;
	}
}

function columns(state = initState.columns, action) {
	if (Object.keys(action).length == 0 || !action.payload) return state;

	switch(action.type) {
		case GET_COLUMNS.REQUEST:
			return state;
		case GET_COLUMNS.SUCCESS:
			let columnsIDs = action.payload.columns.map(c => c.id);
			let oldIDs = state.map(s => s.id);
			let newColumns = [];
			columnsIDs.forEach((c, idx) => {
				if (oldIDs.indexOf(c) == -1)
					newColumns.push(action.payload.columns[idx]);
			});

			return [
				...state,
				...newColumns
			];
		case GET_COLUMNS.FAILED:
			return state;
		default:
			return state;
	}
}

export default combineReducers({
  columnEdit,
  columns
});<commit_msg>add status to boardColumn and addColumn reducer<commit_after>import { combineReducers } from 'redux';
import {
	TOGGLE_EDIT_ITEM,
	GET_COLUMNS,
	ADD_COLUMN
} from '../actions/boardColumn';

let initState = {
	columnEdit: {},
	columns: {
		items: []
	},
	status: 'NORMAL'
};

function columnEdit(state = initState.columnEdit, action) {
	switch(action.type) {
		case TOGGLE_EDIT_ITEM:
			return {
				...state,
				[action.payload.id]: action.payload.item
			};
		default:
			return state;
	}
}

function columns(state = initState.columns, action) {
	// if (Object.keys(action).length == 0 || !action.payload) return state;

	switch(action.type) {
		case GET_COLUMNS.REQUEST:
			return {
				...state,
				status: 'PENDING'
			};
		case GET_COLUMNS.SUCCESS:
			let columnsIDs = action.payload.columns.map(c => c.id);
			let oldIDs = state.items.map(s => s.id);
			let newColumns = [];
			columnsIDs.forEach((c, idx) => {
				if (oldIDs.indexOf(c) == -1)
					newColumns.push(action.payload.columns[idx]);
			});

			return {
				...state,
				items: [
					...state.items,
					...newColumns
				],
				status: 'NORMAL'
			};
		case GET_COLUMNS.FAILED:
			return {
				...state,
				status: 'FAILED'
			};
		case ADD_COLUMN.REQUEST:
			return {
				...state,
				status: 'PENDING'
			};
		case ADD_COLUMN.SUCCESS:
			return {
				...state,
				status: 'NORMAL'
			};
		case ADD_COLUMN.FAILED:
			return {
				...state,
				status: 'FAILED'
			};
		default:
			return state;
	}
}

export default combineReducers({
  columnEdit,
  columns
});
{'fraction_non_alphanumeric': 0.15051704327843737, 'fraction_numerical': 0.0015319800842589046, 'mean_word_length': 2.9696048632218845, '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': '5692441', 'n_tokens_mistral': 1094, 'n_tokens_neox': 935, 'n_words': 186}