rename composable files to composable notation
This commit is contained in:
parent
d851db2fcc
commit
0a3c9f71d8
18 changed files with 217 additions and 202 deletions
21
src/render/composables/useIpcRend.ts
Normal file
21
src/render/composables/useIpcRend.ts
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
|
||||
export default function useIpc () {
|
||||
|
||||
const invoke = async (endpoint: string, payload: any) => {
|
||||
try {
|
||||
const res = await window.ipcRenderer.invoke(endpoint, payload);
|
||||
return res;
|
||||
} catch (e) {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
const post = (endpoint: string, payload: any) => {
|
||||
window.ipcRenderer.send(endpoint, payload);
|
||||
};
|
||||
|
||||
return {
|
||||
invoke,
|
||||
post
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue