src -> packages

This commit is contained in:
草鞋没号 committed 2022-02-08 08:40:04 +08:00
1 parent e4087edffe
commit 1ee86f4979
25 files changed
+9 -11

No files matched your search

+19
View File
@@ -0,0 +1,19 @@
/**
* Example of 'electron-store' usage.
*/
import { ipcMain } from 'electron'
import Store from 'electron-store'
/**
* Expose 'electron-store' to Renderer-process through 'ipcMain.handle'
*/
const store = new Store()
ipcMain.handle(
'electron-store',
async (_evnet, methodSign: string, ...args: any[]) => {
if (typeof (store as any)[methodSign] === 'function') {
return (store as any)[methodSign](...args)
}
return (store as any)[methodSign]
}
)