Skip to content

Commit ad9c254

Browse files
committed
Styled the removeListener & removeAllListeners
They were previously not written with the same style as other parts of the doc. Also there was a couple grammar errors
1 parent 26350f4 commit ad9c254

2 files changed

Lines changed: 19 additions & 20 deletions

File tree

docs/api/ipc-main.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -53,30 +53,30 @@ The `ipcMain` module has the following method to listen for events:
5353
* `channel` String - The event name.
5454
* `callback` Function
5555

56-
When the event occurs the `callback` is called with an `event` object and a
57-
message, `arg`.
58-
59-
Once done listening for messages, if you longer want to activate this callback
60-
and for whatever reason can't merely stop sending messages on the channel, you
61-
can use:
56+
When the event occurs the `callback` is called with an `event` object and
57+
arbitrary arguments.
6258

6359
### `ipcMain.removeListener(channel, callback)`
6460

6561
* `channel` String - The event name.
6662
* `callback` Function - The reference to the same function that you used for
6763
`ipcMain.on(channel, callback)`
6864

69-
Alternatively, if you don't have access to the same callback, you can use:
65+
Once done listening for messages, if you no longer want to activate this
66+
callback and for whatever reason can't merely stop sending messages on the
67+
channel, this function will remove the callback handler for the specified
68+
channel.
7069

7170
### `ipcMain.removeAllListeners(channel)`
7271

7372
* `channel` String - The event name.
7473

75-
This has the expected effect of removing *all* handlers to this ipc channel.
74+
This removes *all* handlers to this ipc channel.
75+
76+
### `ipcMain.once(channel, callback)`
7677

77-
Because of this class' inheritance from the `EventEmitter` node class, you can
78-
also use `ipcMain.once(channel, callback)` to fire handlers meant to occur only
79-
once, as in, they won't be activated after one call of `callback`
78+
Use this in place of `ipcMain.on()` to fire handlers meant to occur only once,
79+
as in, they won't be activated after one call of `callback`
8080

8181
## IPC Event
8282

docs/api/ipc-renderer.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,28 +20,27 @@ The `ipcRenderer` module has the following method to listen for events:
2020
When the event occurs the `callback` is called with an `event` object and
2121
arbitrary arguments.
2222

23-
Once done listening for messages, if you longer want to activate this callback
24-
and for whatever reason can't merely stop sending messages on the channel, you
25-
can use:
26-
2723
### `ipcRenderer.removeListener(channel, callback)`
2824

2925
* `channel` String - The event name.
3026
* `callback` Function - The reference to the same function that you used for
3127
`ipcRenderer.on(channel, callback)`
3228

33-
Alternatively, if you don't have access to the same callback, you can use:
29+
Once done listening for messages, if you no longer want to activate this
30+
callback and for whatever reason can't merely stop sending messages on the
31+
channel, this function will remove the callback handler for the specified
32+
channel.
3433

3534
### `ipcRenderer.removeAllListeners(channel)`
3635

3736
* `channel` String - The event name.
3837

39-
This has the expected effect of removing *all* handlers to this ipc channel.
38+
This removes *all* handlers to this ipc channel.
4039

41-
Because of this class' inheritance from the `EventEmitter` node class, you can
42-
also use `ipcRenderer.once(channel, callback)` to fire handlers meant to occur only
43-
once, as in, they won't be activated after one call of `callback`
40+
### `ipcMain.once(channel, callback)`
4441

42+
Use this in place of `ipcMain.on()` to fire handlers meant to occur only once,
43+
as in, they won't be activated after one call of `callback`
4544

4645
## Sending Messages
4746

0 commit comments

Comments
 (0)