import { Reducer } from 'umi' ; export interface GlobalModelState { collapsed : boolean ; } export interface GlobalModelType { namespace : 'global' ; state : GlobalModelState ; reducers : { changeLayoutCollapsed : Reducer < GlobalModelState > ; } ; } const GlobalModel = { namespace : 'global' , state : { collapsed : false , } , reducers : { changeLayoutCollapsed ( state = { collapsed : true } , { payload } ) { return { ... state , collapsed : payload , } ; } , } , } ; export default GlobalModel ;