import { createStore } from 'dahlia-store' ; interface ModalInstnce { name : string ; data : any ; visible : boolean ; } interface Modals { [ modalName ] : ModalInstnce ; } export const modalStore = createStore ( { modals : { } as Modals , ModalContainer : null , setModalContainer ( cmp ) { modalStore . ModalContainer = cmp ; } , open ( name , data ? ) { modalStore . modals [ name ] = { name , data , visible : true , } ; } , close ( name ) { modalStore . modals [ name ] . visible = false ; } , getModal ( name ) { return modalStore . modals [ name ] ; } , } ) ;