import type { Ref } from "vue"; type TreeState = Record; const store: Record> = {}; export function newTreeKey(): string { return Math.random().toString(36).substring(2); } export function useTreeState(key: string): Ref { if (!store[key]) { store[key] = ref({}); } return store[key]; }