Get threads working reasonably well

This commit is contained in:
Jon Staab
2024-10-01 11:47:21 -07:00
parent 9a4c62e740
commit 3e06c36563
12 changed files with 153 additions and 75 deletions
+6 -2
View File
@@ -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