import { SET_PLC_IPADDRESS, PLC_DATA_RECEIVED, PLC_ERROR_RECEIVED } from "../actions/actions_plc";

export default function(state = {}, action){
	switch(action.type){
	case SET_PLC_IPADDRESS:
		return { ...state, ipAddress: action.payload };

	case PLC_DATA_RECEIVED:
		return { ...state, ...action.payload };

	case PLC_ERROR_RECEIVED:
		return { ...state, error: action.payload };

	default:
		return state;
	}
}
