Get threads working reasonably well
This commit is contained in:
+6
-2
@@ -6,11 +6,15 @@ export const emitter = new Emitter()
|
||||
|
||||
export const modals = new Map()
|
||||
|
||||
export const pushModal = (component: ComponentType, props: Record<string, any> = {}) => {
|
||||
export type ModalOptions = {
|
||||
drawer?: boolean
|
||||
}
|
||||
|
||||
export const pushModal = (component: ComponentType, props: Record<string, any> = {}, options: ModalOptions = {}) => {
|
||||
const id = randomId()
|
||||
|
||||
// TODO: fix memory leak here by listening to history somehow
|
||||
modals.set(id, {component, props})
|
||||
modals.set(id, {component, props, options})
|
||||
goto("#" + id)
|
||||
|
||||
return id
|
||||
|
||||
Reference in New Issue
Block a user