p5.js-web-editor/shared/redux/reducers/project.js
2016-06-20 18:00:40 -04:00

23 lines
No EOL
402 B
JavaScript

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
}
case ActionTypes.NEW_PROJECT:
return {
id: action.id,
name: action.name
}
default:
return state;
}
}
export default project;