desktop: add electron version (#15663)
This commit is contained in:
parent
e4f0825c56
commit
5cf235fa6c
223 changed files with 4292 additions and 46 deletions
15
packages/desktop-electron/src/main/store.ts
Normal file
15
packages/desktop-electron/src/main/store.ts
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
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)
|
||||
Loading…
Add table
Add a link
Reference in a new issue