penguinmod-editor-2 / src /reducers /project-changed.js
soiz1's picture
Upload 2891 files
6bcb42f verified
raw
history blame contribute delete
655 Bytes
const SET_PROJECT_CHANGED = 'scratch-gui/project-changed/SET_PROJECT_CHANGED';
const initialState = false;
const reducer = function (state, action) {
if (typeof state === 'undefined') state = initialState;
switch (action.type) {
case SET_PROJECT_CHANGED:
return action.changed;
default:
return state;
}
};
const setProjectChanged = () => ({
type: SET_PROJECT_CHANGED,
changed: true
});
const setProjectUnchanged = () => ({
type: SET_PROJECT_CHANGED,
changed: false
});
export {
reducer as default,
initialState as projectChangedInitialState,
setProjectChanged,
setProjectUnchanged
};