p5.js-web-editor/client/modules/IDE/reducers/projects.js
kaganjd 76bd1b1630 Add ability to delete projects from sketch list (#125)
* Add ability to delete projects from sketch list

- Fixes #76
- Also gets rid of outdated Sketch module

* Styling for Sketch List trash can

* Merge all the stuff

* Fix trash can line height
2016-10-12 14:24:53 -04:00

16 lines
367 B
JavaScript

import * as ActionTypes from '../../../constants';
const sketches = (state = [], action) => {
switch (action.type) {
case ActionTypes.SET_PROJECTS:
return action.projects;
case ActionTypes.DELETE_PROJECT:
return state.filter((sketch) =>
sketch.id !== action.id
);
default:
return state;
}
};
export default sketches;