src -> packages
This commit is contained in:
1 parent
e4087edffe
commit
1ee86f4979
25 files changed
+9
-11
No files matched your search
@@ -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]
|
||||
}
|
||||
)
|
||||
Reference in new issue
Block a user