mirror of
https://github.com/electron/electron.git
synced 2026-01-09 15:38:08 -05:00
docs: Make ipcRenderer and ipcMain listener API docs consistent (#44651)
* docs: Make ipcRenderer and ipcMain listener API docs consistent * test: add some unit tests for ipcRenderer/ipcMain listener behavior * fix: Mark on/off methods as primary and addListener/removeListener as aliases * fix: clear all listeners before running ipcMain removeAllListeners tests
This commit is contained in:
@@ -48,7 +48,8 @@ Listens to `channel`, when a new message arrives `listener` would be called with
|
||||
* `event` [IpcRendererEvent][ipc-renderer-event]
|
||||
* `...args` any[]
|
||||
|
||||
Alias for [`ipcRenderer.removeListener`](#ipcrendererremovelistenerchannel-listener).
|
||||
Removes the specified `listener` from the listener array for the specified
|
||||
`channel`.
|
||||
|
||||
### `ipcRenderer.once(channel, listener)`
|
||||
|
||||
@@ -76,14 +77,13 @@ Alias for [`ipcRenderer.on`](#ipcrendereronchannel-listener).
|
||||
* `event` [IpcRendererEvent][ipc-renderer-event]
|
||||
* `...args` any[]
|
||||
|
||||
Removes the specified `listener` from the listener array for the specified
|
||||
`channel`.
|
||||
Alias for [`ipcRenderer.off`](#ipcrendereroffchannel-listener).
|
||||
|
||||
### `ipcRenderer.removeAllListeners(channel)`
|
||||
### `ipcRenderer.removeAllListeners([channel])`
|
||||
|
||||
* `channel` string
|
||||
* `channel` string (optional)
|
||||
|
||||
Removes all listeners, or those of the specified `channel`.
|
||||
Removes all listeners from the specified `channel`. Removes all listeners from all channels if no channel is specified.
|
||||
|
||||
### `ipcRenderer.send(channel, ...args)`
|
||||
|
||||
|
||||
Reference in New Issue
Block a user