From 76fd04aa7426a979fa5ef66f1965a77ab8f9b012 Mon Sep 17 00:00:00 2001 From: Vixalie Date: Mon, 4 Aug 2025 22:44:34 +0800 Subject: [PATCH] =?UTF-8?q?feat(stores):=20=E6=B7=BB=E5=8A=A0=E5=85=B1?= =?UTF-8?q?=E4=BA=AB=E5=AD=98=E5=82=A8=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 shared-storage.ts 文件 - 使用 Solid Primitives 的持久化存储功能 - 创建并导出 comfyLocation 信号和其设置函数 --- src/stores/shared-storage.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 src/stores/shared-storage.ts diff --git a/src/stores/shared-storage.ts b/src/stores/shared-storage.ts new file mode 100644 index 0000000..96ec87f --- /dev/null +++ b/src/stores/shared-storage.ts @@ -0,0 +1,11 @@ +import { makePersisted } from '@solid-primitives/storage'; +import { tauriStorage } from '@solid-primitives/storage/tauri'; +import { createSignal } from 'solid-js'; + +const storage = tauriStorage(); + +// eslint-disable-next-line solid/reactivity +export const [comfyLocation, setComfyLocation] = makePersisted(createSignal(''), { + storage, + name: 'comfy-location', +});