@@ -23,30 +23,24 @@ yarn add electron-devtools-installer -D
2323```
2424
2525## Usage
26- In your ` electron-starter.js ` file, add the following callback to ` app.on('ready', ... ) ` ,
26+ All you have to do now is this in the ** main ** process of your application.
2727
2828``` js
29- const { default: installExtension , REDUX_DEVTOOLS } = require (' electron-devtools-installer' );
30- const { app , BrowserWindow } = require (' electron' );
29+ import installExtension , { REDUX_DEVTOOLS } from ' electron-devtools-installer' ;
30+ // Or if you can not use ES6 imports
31+ /**
32+ const { default: installExtension, REACT_DEVELOPER_TOOLS } = require('electron-devtools-installer');
33+ */
34+ const { app } = require (' electron' );
3135
32- app .on ( ' ready ' , () => {
36+ app .whenReady (). then ( () => {
3337 installExtension (REDUX_DEVTOOLS )
3438 .then ((name ) => console .log (` Added Extension: ${ name} ` ))
3539 .catch ((err ) => console .log (' An error occurred: ' , err));
3640});
3741```
3842To install multiple extensions, ` installExtension ` takes an array.
3943
40- Alternatively, using ` require() ` and destructuring (node v6 or higher) you can
41-
42- ``` js
43- const { default: installExtension , REACT_DEVELOPER_TOOLS } = require (' electron-devtools-installer' );
44-
45- installExtension (REACT_DEVELOPER_TOOLS )
46- .then ((name ) => console .log (` Added Extension: ${ name} ` ))
47- .catch ((err ) => console .log (' An error occurred: ' , err));
48- ```
49-
5044## What extensions can I use?
5145
5246Technically you can use whatever extension you want. Simply find the ChromeStore ID
0 commit comments