p5.js-web-editor/shared/redux/reducers/project.js

23 lines
402 B
JavaScript
Raw Normal View History

import * as ActionTypes from '../constants/constants';
const initialState = {
name: "Hello p5.js"
}
const project = (state = initialState, action) => {
switch (action.type) {
case ActionTypes.SET_PROJECT_NAME:
return {
name: action.name
}
2016-06-17 18:11:52 +00:00
case ActionTypes.NEW_PROJECT:
return {
2016-06-17 20:40:13 +00:00
id: action.id,
2016-06-17 18:11:52 +00:00
name: action.name
}
default:
return state;
}
}
export default project;