📝 Update API documentation to ES6 [ci skip]
This commit is contained in:
parent
178496afe5
commit
5a9f28e034
28 changed files with 168 additions and 176 deletions
|
@ -12,12 +12,11 @@ event of the app module is emitted.
|
|||
|
||||
```javascript
|
||||
const electron = require('electron');
|
||||
const app = electron.app;
|
||||
const globalShortcut = electron.globalShortcut;
|
||||
const { app, globalShortcut } = electron;
|
||||
|
||||
app.on('ready', function() {
|
||||
app.on('ready', () => {
|
||||
// Register a 'CommandOrControl+X' shortcut listener.
|
||||
var ret = globalShortcut.register('CommandOrControl+X', function() {
|
||||
const ret = globalShortcut.register('CommandOrControl+X', function() {
|
||||
console.log('CommandOrControl+X is pressed');
|
||||
});
|
||||
|
||||
|
@ -29,7 +28,7 @@ app.on('ready', function() {
|
|||
console.log(globalShortcut.isRegistered('CommandOrControl+X'));
|
||||
});
|
||||
|
||||
app.on('will-quit', function() {
|
||||
app.on('will-quit', () => {
|
||||
// Unregister a shortcut.
|
||||
globalShortcut.unregister('CommandOrControl+X');
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue