2016-08-15 21:06:12 +00:00
|
|
|
import * as ActionTypes from '../../../constants';
|
|
|
|
|
|
|
|
const sketches = (state = [], action) => {
|
|
|
|
switch (action.type) {
|
|
|
|
case ActionTypes.SET_PROJECTS:
|
|
|
|
return action.projects;
|
2016-10-12 18:24:53 +00:00
|
|
|
case ActionTypes.DELETE_PROJECT:
|
2017-02-22 19:29:35 +00:00
|
|
|
return state.filter(sketch =>
|
2016-10-12 18:24:53 +00:00
|
|
|
sketch.id !== action.id
|
|
|
|
);
|
2016-08-15 21:06:12 +00:00
|
|
|
default:
|
|
|
|
return state;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
export default sketches;
|