import { IpcChannels, IpcChannelsReturns } from '@/shared/IpcChannels' import { useEffect } from 'react' const useIpcRenderer = ( channel: T, listener: (event: any, value: IpcChannelsReturns[T]) => void ) => { useEffect(() => { return window.ipcRenderer?.on(channel, listener) }, []) } export default useIpcRenderer