mirror of
https://github.com/scratchfoundation/scratch-paint.git
synced 2024-12-23 05:52:42 -05:00
26 lines
547 B
JavaScript
26 lines
547 B
JavaScript
|
const SET_FILLED = 'scratch-paint/fill-bitmap-shapes/SET_FILLED';
|
||
|
const initialState = true;
|
||
|
|
||
|
const reducer = function (state, action) {
|
||
|
if (typeof state === 'undefined') state = initialState;
|
||
|
switch (action.type) {
|
||
|
case SET_FILLED:
|
||
|
return action.filled;
|
||
|
default:
|
||
|
return state;
|
||
|
}
|
||
|
};
|
||
|
|
||
|
// Action creators ==================================
|
||
|
const setShapesFilled = function (filled) {
|
||
|
return {
|
||
|
type: SET_FILLED,
|
||
|
filled: filled
|
||
|
};
|
||
|
};
|
||
|
|
||
|
export {
|
||
|
reducer as default,
|
||
|
setShapesFilled
|
||
|
};
|