feat(stores): 添加共享存储模块
- 新增 shared-storage.ts 文件 - 使用 Solid Primitives 的持久化存储功能 - 创建并导出 comfyLocation 信号和其设置函数
This commit is contained in:
11
src/stores/shared-storage.ts
Normal file
11
src/stores/shared-storage.ts
Normal file
@@ -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<string>(''), {
|
||||||
|
storage,
|
||||||
|
name: 'comfy-location',
|
||||||
|
});
|
Reference in New Issue
Block a user