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

23 lines
424 B
JavaScript
Raw Normal View History

2016-06-17 19:37:29 +02:00
import * as ActionTypes from '../constants/constants';
const initialState = {
isPreferencesShowing: false
}
const preferences = (state = initialState, action) => {
switch (action.type) {
2016-06-17 20:31:33 +02:00
case ActionTypes.OPEN_PREFERENCES:
2016-06-17 19:37:29 +02:00
return {
2016-06-17 20:31:33 +02:00
isPreferencesShowing: true
}
case ActionTypes.CLOSE_PREFERENCES:
return {
isPreferencesShowing: false
2016-06-17 19:37:29 +02:00
}
default:
return state
}
}
export default preferences;