]> khamidou — GitHub mirrors - electron.git/commitdiff
Styled the removeListener & removeAllListeners
authorMing Luo <mcluo1994@gmail.com>
Thu, 14 Jan 2016 14:27:24 +0000 (09:27 -0500)
committerMing Luo <mcluo1994@gmail.com>
Thu, 14 Jan 2016 14:27:24 +0000 (09:27 -0500)
They were previously not written with the same style as other parts of
the doc. Also there was a couple grammar errors

docs/api/ipc-main.md
docs/api/ipc-renderer.md

index 87430e7e99662410a3e12efea3405894ba5b6ccc..337d86be217b5b8604d4cf4cd2e7ecd289b1afdb 100644 (file)
@@ -53,12 +53,8 @@ The `ipcMain` module has the following method to listen for events:
 * `channel` String - The event name.
 * `callback` Function
 
-When the event occurs the `callback` is called with an `event` object and a
-message, `arg`.
-
-Once done listening for messages, if you longer want to activate this callback
-and for whatever reason can't merely stop sending messages on the channel, you
-can use:
+When the event occurs the `callback` is called with an `event` object and
+arbitrary arguments.
 
 ### `ipcMain.removeListener(channel, callback)`
 
@@ -66,17 +62,21 @@ can use:
 * `callback` Function - The reference to the same function that you used for
   `ipcMain.on(channel, callback)`
 
-Alternatively, if you don't have access to the same callback, you can use:
+Once done listening for messages, if you no longer want to activate this
+callback and for whatever reason can't merely stop sending messages on the
+channel, this function will remove the callback handler for the specified
+channel.
 
 ### `ipcMain.removeAllListeners(channel)`
 
 * `channel` String - The event name.
 
-This has the expected effect of removing *all* handlers to this ipc channel.
+This removes *all* handlers to this ipc channel.
+
+### `ipcMain.once(channel, callback)`
 
-Because of this class' inheritance from the `EventEmitter` node class, you can
-also use `ipcMain.once(channel, callback)` to fire handlers meant to occur only
-once, as in, they won't be activated after one call of `callback`
+Use this in place of `ipcMain.on()` to fire handlers meant to occur only once,
+as in, they won't be activated after one call of `callback`
 
 ## IPC Event
 
index d88b477ea71475395aaaaa4e25f7a729fa0c522c..090fd1a9119d2322e76855d35443b4b62def1862 100644 (file)
@@ -20,28 +20,27 @@ The `ipcRenderer` module has the following method to listen for events:
 When the event occurs the `callback` is called with an `event` object and
 arbitrary arguments.
 
-Once done listening for messages, if you longer want to activate this callback
-and for whatever reason can't merely stop sending messages on the channel, you
-can use:
-
 ### `ipcRenderer.removeListener(channel, callback)`
 
 * `channel` String - The event name.
 * `callback` Function - The reference to the same function that you used for
   `ipcRenderer.on(channel, callback)`
 
-Alternatively, if you don't have access to the same callback, you can use:
+Once done listening for messages, if you no longer want to activate this
+callback and for whatever reason can't merely stop sending messages on the
+channel, this function will remove the callback handler for the specified
+channel.
 
 ### `ipcRenderer.removeAllListeners(channel)`
 
 * `channel` String - The event name.
 
-This has the expected effect of removing *all* handlers to this ipc channel.
+This removes *all* handlers to this ipc channel.
 
-Because of this class' inheritance from the `EventEmitter` node class, you can
-also use `ipcRenderer.once(channel, callback)` to fire handlers meant to occur only
-once, as in, they won't be activated after one call of `callback`
+### `ipcMain.once(channel, callback)`
 
+Use this in place of `ipcMain.on()` to fire handlers meant to occur only once,
+as in, they won't be activated after one call of `callback`
 
 ## Sending Messages