mirror of
https://github.com/GiriNeko/YesPlayMusic.git
synced 2025-12-17 13:48:02 +00:00
feat: updates
This commit is contained in:
parent
f340a90117
commit
cec4c5909d
50 changed files with 1304 additions and 207 deletions
|
|
@ -1,12 +1,12 @@
|
|||
import { IpcChannelsParams, IpcChannelsReturns } from '@/shared/IpcChannels'
|
||||
import { IpcChannels, IpcChannelsReturns } from '@/shared/IpcChannels'
|
||||
import { useEffect } from 'react'
|
||||
|
||||
const useIpcRenderer = <T extends keyof IpcChannelsParams>(
|
||||
channcel: T,
|
||||
const useIpcRenderer = <T extends IpcChannels>(
|
||||
channel: T,
|
||||
listener: (event: any, value: IpcChannelsReturns[T]) => void
|
||||
) => {
|
||||
useEffect(() => {
|
||||
return window.ipcRenderer?.on(channcel, listener)
|
||||
return window.ipcRenderer?.on(channel, listener)
|
||||
}, [])
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue