Files
tf_code/packages/desktop-electron/src/main/store.ts
2026-03-04 15:12:34 +08:00

16 lines
355 B
TypeScript

import Store from "electron-store"
import { SETTINGS_STORE } from "./constants"
const cache = new Map<string, Store>()
export function getStore(name = SETTINGS_STORE) {
const cached = cache.get(name)
if (cached) return cached
const next = new Store({ name })
cache.set(name, next)
return next
}
export const store = getStore(SETTINGS_STORE)