Schedule work to be completed when the user agent is idle. Weighs 270 bytes compressed.
var NanoScheduler =var scheduler =var i = 10000while i-- scheduler
Just like with
window.requestAnimationFrame, it's much more efficient to
share a single instance than to call it for each piece of work. There's a
significant overhead when scheduling small amounts of work. This package allows
sharing a scheduler as a singleton, which makes it particularly useful to be
shared between multiple applications.
scheduler = NanoScheduler()
Create a new scheduler instance. The instance is shared as a singleton on
window (if available).
Push a callback into the scheduler, to be executed when the user agent is idle.
$ npm install nanoscheduler