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:
Matthew Shen 2021-08-01 21:57:37 -04:00 committed by GitHub
parent ced2e8779f
commit c0e72bd335
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 33 additions and 33 deletions

View file

@ -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