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

26 lines
449 B
JavaScript
Raw Normal View History

2016-05-11 22:13:17 +02:00
import * as ActionTypes from '../constants/constants';
const initialState = {
isPlaying: false
}
const ide = (state = initialState, action) => {
switch (action.type) {
case ActionTypes.TOGGLE_SKETCH:
return {
isPlaying: !state.isPlaying
}
2016-05-12 23:40:49 +02:00
case ActionTypes.START_SKETCH:
return {
isPlaying: true
}
case ActionTypes.STOP_SKETCH:
return {
isPlaying: false
}
2016-05-11 22:13:17 +02:00
default:
return state
}
}
export default ide;