Files
ComfyUI_frontend/src/stores/graphStore.ts
Chenlei Hu 2cb1cea196 Make LGraphCanvas shallowReactive (#1169)
* Make LGraphCanvas shallowReactive

* Restore canvas options after creation
2024-10-08 14:07:15 -04:00

25 lines
585 B
TypeScript

import { LGraphNode, LGraphGroup, LGraphCanvas } from '@comfyorg/litegraph'
import { defineStore } from 'pinia'
import { shallowRef } from 'vue'
export const useTitleEditorStore = defineStore('titleEditor', () => {
const titleEditorTarget = shallowRef<LGraphNode | LGraphGroup | null>(null)
return {
titleEditorTarget
}
})
export const useCanvasStore = defineStore('canvas', () => {
/**
* The LGraphCanvas instance.
*
* The root LGraphCanvas object is shallow reactive.
*/
const canvas = shallowRef<LGraphCanvas | null>(null)
return {
canvas
}
})