Skip to content

isabella232/scheduler-polyfill

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

A polyfill for self.scheduler

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%