function componentsReducers(state = defaultState, action) {
	switch (action.type) {
		case CONSTANTS.COMPONENT_ADD_STATE:
			warnIfAnotherComponentBind(state, action);
			if (action.initialComponentState) {
				return state.setIn(
					[action.componentName, action.key],
					fromJS(action.initialComponentState),
				);
			}
			return state.setIn([action.componentName, action.key], new Map());
		case CONSTANTS.COMPONENT_MERGE_STATE:
			errorIfMergingStateDoesntExist(state, action);

			return state.mergeIn([action.componentName, action.key], fromJS(action.componentState));
		case CONSTANTS.COMPONENT_REMOVE_STATE:
			warnIfRemovingStateDoesntExist(state, action);
			return state.deleteIn([action.componentName, action.key]);
		default: {
			const subAction = get(action, 'cmf.componentState');
			if (subAction) {
				return componentsReducers(state, subAction);
			}
			return state;
		}
	}
}
/**
 * Reducer on charge to manage component remote state.
 * @param  {object} state  initial state
 * @param  {object} action the executed action
 * @return {object}        the new state
 */
Reducer on charge to manage component remote state.
@param  {object} state  initial state
@param  {object} action the executed action
@return {object}        the new state
Reducer on charge to manage component remote state . @param { object } state initial state @param { object } action the executed action @return { object } the new state
function componentsReducers(state = defaultState, action) {
	switch (action.type) {
		case CONSTANTS.COMPONENT_ADD_STATE:
			warnIfAnotherComponentBind(state, action);
			if (action.initialComponentState) {
				return state.setIn(
					[action.componentName, action.key],
					fromJS(action.initialComponentState),
				);
			}
			return state.setIn([action.componentName, action.key], new Map());
		case CONSTANTS.COMPONENT_MERGE_STATE:
			errorIfMergingStateDoesntExist(state, action);
			return state.mergeIn([action.componentName, action.key], fromJS(action.componentState));
		case CONSTANTS.COMPONENT_REMOVE_STATE:
			warnIfRemovingStateDoesntExist(state, action);
			return state.deleteIn([action.componentName, action.key]);
		default: {
			const subAction = get(action, 'cmf.componentState');
			if (subAction) {
				return componentsReducers(state, subAction);
			}
			return state;
		}
	}
}
function componentsReducers ( state = defaultState , action ) { switch ( action . type ) { case CONSTANTS . COMPONENT_ADD_STATE : warnIfAnotherComponentBind ( state , action ) ; if ( action . initialComponentState ) { return state . setIn ( [ action . componentName , action . key ] , fromJS ( action . initialComponentState ) , ) ; } return state . setIn ( [ action . componentName , action . key ] , new Map ( ) ) ; case CONSTANTS . COMPONENT_MERGE_STATE : errorIfMergingStateDoesntExist ( state , action ) ; return state . mergeIn ( [ action . componentName , action . key ] , fromJS ( action . componentState ) ) ; case CONSTANTS . COMPONENT_REMOVE_STATE : warnIfRemovingStateDoesntExist ( state , action ) ; return state . deleteIn ( [ action . componentName , action . key ] ) ; default : { const subAction = get ( action , 'cmf.componentState' ) ; if ( subAction ) { return componentsReducers ( state , subAction ) ; } return state ; } } }
Reducer on charge to manage component remote state.
Reducer on charge to manage component remote state .