diff --git a/src/shared/store/pinnedFlowchart.ts b/src/shared/store/pinnedFlowchart.ts new file mode 100644 index 0000000..aa32086 --- /dev/null +++ b/src/shared/store/pinnedFlowchart.ts @@ -0,0 +1,18 @@ +import { defineStore } from "pinia" + +export const usePinnedFlowchartStore = defineStore("pinnedFlowchart", () => { + const isPinned = ref(false) + const mermaidCode = ref("") + + function pin(code: string) { + mermaidCode.value = code + isPinned.value = true + } + + function unpin() { + isPinned.value = false + mermaidCode.value = "" + } + + return { isPinned, mermaidCode, pin, unpin } +})