You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
434 B
21 lines
434 B
const initialState = {
|
|
lights: [],
|
|
};
|
|
|
|
const LIGHTS_RECEIVED = "LightReducer/Received";
|
|
|
|
const lightReducer = (state = initialState, {type, payload} = {}) => {
|
|
switch (type) {
|
|
case LIGHTS_RECEIVED:
|
|
return {
|
|
...state,
|
|
lights: payload,
|
|
};
|
|
default:
|
|
return state;
|
|
}
|
|
};
|
|
|
|
export const lightsReceivedEvent = (lights) => ({type: LIGHTS_RECEIVED, payload: lights});
|
|
|
|
export default lightReducer;
|