import { createStore } from 'dahlia-store' ; interface DrawerInstnce { name : string ; data : any ; visible : boolean ; } interface Drawers { [ DrawerName ] : DrawerInstnce ; } export const drawerStore = createStore ( { drawers : { } as Drawers , open ( name , data ? ) { drawerStore . drawers [ name ] = { name , data , visible : true , } ; } , close ( name ) { drawerStore . drawers [ name ] . visible = false ; } , getDrawer ( name ) { return drawerStore . drawers [ name ] ; } , } ) ;