Skip to content

Commit

Permalink
fix(useIpcRenderer): set explicit return type
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Dec 16, 2023
1 parent 98985a4 commit dd82044
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/electron/useIpcRenderer/index.ts
Expand Up @@ -90,8 +90,8 @@ export interface UseIpcRendererReturn {
* Create a `sendSync` function
*/
function setSendSync(ipcRenderer: IpcRenderer) {
return <T>(channel: string, ...args: any[]) => {
const result = shallowRef<T | null>(null)
return <T>(channel: string, ...args: any[]): Ref<T | null> => {
const result = shallowRef<T | null>(null) as Ref<T | null>
result.value = ipcRenderer.sendSync(channel, ...args)
return result
}
Expand Down

0 comments on commit dd82044

Please sign in to comment.