You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
390 B
JavaScript
22 lines
390 B
JavaScript
5 years ago
|
export default function reducer(state = {
|
||
|
lang: Context.code_lang,
|
||
|
code: Context.code_template,
|
||
|
}, action) {
|
||
|
switch (action.type) {
|
||
|
case 'SCRATCHPAD_EDITOR_UPDATE_CODE': {
|
||
|
return {
|
||
|
...state,
|
||
|
code: action.payload,
|
||
|
};
|
||
|
}
|
||
|
case 'SCRATCHPAD_EDITOR_SET_LANG': {
|
||
|
return {
|
||
|
...state,
|
||
|
lang: action.payload,
|
||
|
};
|
||
|
}
|
||
|
default:
|
||
|
return state;
|
||
|
}
|
||
|
}
|