window.cancelIdleCallback()

Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

Summary

The window.cancelIdleCallback() method cancels a callback previously scheduled with window.requestIdleCallback().

Syntax

window.cancelIdleCallback(handle);

Parameters

handle

The ID value returned by window.requestIdleCallback() when the callback was established.

Return value

undefined.

Example

See our complete example in the article Cooperative Scheduling of Background Tasks API.

Specifications

Specification
Cooperative Scheduling of Background Tasks
# the-cancelidlecallback-method

Browser compatibility

BCD tables only load in the browser

See also