mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-11 07:33:05 -04:00
Refactor webpack; Add ErrorBoundary
This commit is contained in:
parent
98cb301df5
commit
a7ccbcfca4
10 changed files with 233 additions and 150 deletions
|
@ -8,7 +8,7 @@ export default {
|
|||
if (event in IPC_EVENTS) ipcRenderer.send(event, ...args);
|
||||
else throw new Error(`Event ${event} not allowed.`);
|
||||
},
|
||||
sendSync(event: string, ...args: any[]) {
|
||||
sendSync<T = any>(event: string, ...args: any[]): T {
|
||||
if (event in IPC_EVENTS) return ipcRenderer.sendSync(event, ...args);
|
||||
else throw new Error(`Event ${event} not allowed.`);
|
||||
},
|
||||
|
@ -16,7 +16,7 @@ export default {
|
|||
if (event in IPC_EVENTS) ipcRenderer.on(event, listener);
|
||||
else throw new Error(`Event ${event} not allowed.`);
|
||||
},
|
||||
invoke(event: string, ...args: any[]) {
|
||||
invoke<T = any>(event: string, ...args: any[]): Promise<T> {
|
||||
if (event in IPC_EVENTS) return ipcRenderer.invoke(event, ...args);
|
||||
else throw new Error(`Event ${event} not allowed.`);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue