docs: update to the use of arrow functions in line with the style guide (#30194)
* docs: Update to the use of arrow functions in line with the style guide * docs: Fixed unmatched bracket typo in previous commit 9ebe3e58f7948c6636d77f3c58a2693683b69691 * fix linting Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
This commit is contained in:
parent
ced2e8779f
commit
c0e72bd335
16 changed files with 33 additions and 33 deletions
|
@ -41,7 +41,7 @@ Starting with an HTML file `index.html`, this example will demonstrate how the `
|
|||
In order to mutate the DOM, create a `renderer.js` file that adds event listeners to the `'online'` and `'offline'` `window` events. The event handler sets the content of the `<strong id='status'>` element depending on the result of `navigator.onLine`.
|
||||
|
||||
```js title='renderer.js'
|
||||
function updateOnlineStatus () {
|
||||
const updateOnlineStatus = () => {
|
||||
document.getElementById('status').innerHTML = navigator.onLine ? 'online' : 'offline'
|
||||
}
|
||||
|
||||
|
@ -56,7 +56,7 @@ Finally, create a `main.js` file for main process that creates the window.
|
|||
```js title='main.js'
|
||||
const { app, BrowserWindow } = require('electron')
|
||||
|
||||
function createWindow () {
|
||||
const createWindow = () => {
|
||||
const onlineStatusWindow = new BrowserWindow({
|
||||
width: 400,
|
||||
height: 100
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue