Polyfill of self.scheduler API
npm install @christiango/scheduler-polyfillThis 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 throughself.scheduler, as well as TaskController and TaskPriorityChangeEvent
classes.
The implementation uses a combination of setTimeout, MessageChannel, andrequestIdleCallback to implement task scheduling, falling back to setTimeout
when other APIs are not available.
A browser that supports ES6 is required for this polyfill.
Include via unpkg:
``html`
Using with npm and a bundler:
`console`
npm install scheduler-polyfill
`js`
import 'scheduler-polyfill';
Building from source:
`console`
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/
`html``