Socket
Socket
Sign inDemoInstall

scheduler-polyfill

Package Overview
Dependencies
0
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    scheduler-polyfill

Polyfill of self.scheduler API


Version published
Weekly downloads
1.9K
decreased by-21.31%
Maintainers
1
Install size
61.0 kB
Created
Weekly downloads
 

Readme

Source

Scheduler Polyfill

This is a polyfill for the Prioritized Task Scheduling API. Documentation on the API shape along with examples can be found in the explainer.

The polyfill includes implementations of Scheduler, exposed through self.scheduler, as well as TaskController and TaskPriorityChangeEvent classes.

The implementation uses a combination of setTimeout, MessageChannel, and requestIdleCallback to implement task scheduling, falling back to setTimeout when other APIs are not available.

Requirements

A browser that supports ES6 is required for this polyfill.

Usage

Include via unpkg:

<script src="https://unpkg.com/scheduler-polyfill"></script>

Using with npm and a bundler:

npm install scheduler-polyfill
import 'scheduler-polyfill';

Building from source:

git clone https://github.com/GoogleChromeLabs/scheduler-polyfill
cd scheduler-polyfill
npm i
npm test        # Tests should pass
npm run build   # Outputs minified polyfill to dist/
<script src="/path_to_polyfill/scheduler-polyfill.js"></script>

License

Apache 2.0

Keywords

FAQs

Last updated on 24 Aug 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc