mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-05-11 18:47:36 -03:00
16 lines
275 B
TypeScript
16 lines
275 B
TypeScript
import type { App as VueApp } from 'vue'
|
|
|
|
export function createVueWidgetCleanup(vueApp: VueApp, onCleanup?: () => void) {
|
|
let didUnmount = false
|
|
|
|
return () => {
|
|
if (didUnmount) {
|
|
return
|
|
}
|
|
|
|
vueApp.unmount()
|
|
didUnmount = true
|
|
onCleanup?.()
|
|
}
|
|
}
|