Scheduling
Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
The Scheduling
object provides methods and properties to control scheduling tasks within the current document.
Instance methods
isInputPending()
Experimental-
Returns a
Boolean
Example
js
function executeTasks() {
const scheduling = navigator.scheduling;
const isInputPending = scheduling.isInputPending();
if (isInputPending) {
setTimeout(isInputPending, 0);
return;
}
// imagine `tasks` require more time to execution
tasks.forEach(() => task.execute());
}
Specifications
Specification |
---|
Early detection of input events # the-scheduling-interface |
Browser compatibility
BCD tables only load in the browser