Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
feat(powerMonitor): expose interface to query system idle state #11807
This PR intend to expose 2 static method to
There are handful of users need this features (including old backlog issue like #1528), and most cases user relies on native modules (https://www.npmjs.com/package/@paulcbetts/system-idle-time / https://www.npmjs.com/package/desktop-idle, etcs). This PR exposes interface to chromium's implementation removes need of custom native module.
accepts non-negative number as a threshold in seconds to be considered as system idle, notify callback with current state. Callback can be resolved synchronously or either asynchronously, depends on platform support. Among state,
notifys callback with system idle time in seconds.
Can remove the call to
Mostly LGTM, nice idea && thanks for the PR.
A couple of questions and suggestions inline