refactor: ginify powerMonitor (#22751)
This commit is contained in:
parent
aeae0d47bd
commit
07cd70a37e
10 changed files with 216 additions and 176 deletions
|
@ -4,22 +4,6 @@
|
|||
|
||||
Process: [Main](../glossary.md#main-process)
|
||||
|
||||
|
||||
This module cannot be used until the `ready` event of the `app`
|
||||
module is emitted.
|
||||
|
||||
For example:
|
||||
|
||||
```javascript
|
||||
const { app, powerMonitor } = require('electron')
|
||||
|
||||
app.whenReady().then(() => {
|
||||
powerMonitor.on('suspend', () => {
|
||||
console.log('The system is going to sleep')
|
||||
})
|
||||
})
|
||||
```
|
||||
|
||||
## Events
|
||||
|
||||
The `powerMonitor` module emits the following events:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue