📝 Match destructuring style
[ci skip]
This commit is contained in:
parent
5787bb0226
commit
4d7296e1db
24 changed files with 37 additions and 39 deletions
|
@ -19,7 +19,7 @@ scripts to be able to use those modules.
|
|||
The main process script is just like a normal Node.js script:
|
||||
|
||||
```javascript
|
||||
const { app, BrowserWindow } = require('electron');
|
||||
const {app, BrowserWindow} = require('electron');
|
||||
|
||||
let window = null;
|
||||
|
||||
|
@ -37,8 +37,8 @@ extra ability to use node modules:
|
|||
<html>
|
||||
<body>
|
||||
<script>
|
||||
const { remote } = require('electron');
|
||||
console.log(remote.app.getVersion());
|
||||
const {app} = require('electron').remote;
|
||||
console.log(app.getVersion());
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -53,7 +53,7 @@ As of 0.37, you can use
|
|||
built-in modules.
|
||||
|
||||
```javascript
|
||||
const { app, BrowserWindow } = require('electron');
|
||||
const {app, BrowserWindow} = require('electron');
|
||||
```
|
||||
|
||||
If you need the entire `electron` module, you can require it and then using
|
||||
|
@ -61,7 +61,7 @@ destructuring to access the individual modules from `electron`.
|
|||
|
||||
```javascript
|
||||
const electron = require('electron');
|
||||
const { app, BrowserWindow } = electron;
|
||||
const {app, BrowserWindow} = electron;
|
||||
```
|
||||
|
||||
This is equivalent to the following code:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue