1
0
mirror of https://github.com/alice-lg/alice-lg.git synced 2024-05-11 05:55:03 +00:00
alice-lg-alice-lg/client/components/routeservers/routes/bgp-attributes-modal-reducer.jsx
2017-05-16 13:34:00 +02:00

32 lines
668 B
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* Bgp Attributes Modal Reducer
*
* @author Matthias Hannig <mha@ecix.net>
*/
import {SHOW_BGP_ATTRIBUTES_MODAL,
HIDE_BGP_ATTRIBUTES_MODAL,
SET_BGP_ATTRIBUTES} from './bgp-attributes-modal-actions'
const initialState = {
show: false,
bgpAttributes: {}
};
export default function reducer(state = initialState, action) {
switch(action.type) {
case SHOW_BGP_ATTRIBUTES_MODAL:
return Object.assign({}, state, { show: true });
case HIDE_BGP_ATTRIBUTES_MODAL:
return Object.assign({}, state, { show: false });
case SET_BGP_ATTRIBUTES:
return Object.assign({}, state, action.payload);
}
return state;
}