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
3.3K
increased by12.07%
Maintainers
1
Install size
59.8 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.

Usage

Requirements

A browser that supports ES6 is required for this polyfill.

Local Builds

Download and Build the Polyfill
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/
Usage in Browsers

The following will add self.scheduler if it does not exist, along with the TaskController and TaskPriorityChangeEvent classes.

<script src="/path_to_polyfill/scheduler-polyfill.js"></script>

License

Apache 2.0

Keywords

FAQs

Last updated on 29 Nov 2021

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