19 lines
513 B
JavaScript
19 lines
513 B
JavaScript
|
const uiReducer = (state = {
|
||
|
showMenu: false,
|
||
|
showLoading: false
|
||
|
}, action) => {
|
||
|
switch (action.type) {
|
||
|
case 'ui_show_menu':
|
||
|
return {...state, showMenu: true };
|
||
|
case 'ui_hide_menu':
|
||
|
return {...state, showMenu: false };
|
||
|
case 'ui_show_loading':
|
||
|
return {...state, showLoading: true};
|
||
|
case 'ui_hide_loading':
|
||
|
return {...state, showLoading: false};
|
||
|
default:
|
||
|
return state;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
export default uiReducer;
|