package
Schedule work to be completed when the browser is idle.
npm install nanoschedulerGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
Estimated unpacked size across 2 packages.
20.3 kB
Includes dependencies.
Schedule work to be completed when the user agent is idle. Weighs 270 bytes compressed.
var NanoScheduler = require('nanoscheduler')
var scheduler = NanoScheduler()
var i = 10000
while (i--) scheduler.push(() => console.log(`idle time! ${Date.now()}`))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).
scheduler.push(cb)Push a callback into the scheduler, to be executed when the user agent is idle.
$ npm install nanoschedulerbenlyn
bendik.lynghaug@gmail.com
bret
bcomnes@gmail.com
lrlna
shestak.irina@gmail.com
yerkopalma
yerko.palma@usach.cl
juliangruber
julian@juliangruber.com
timwis
tim@timwis.com
ahdinosaur
michael.williams@enspiral.com
toddself
todd@selfassembled.org
sethvincent
sethvincent@gmail.com
maxogden
max@maxogden.com
shama
kyle@dontkry.com
freeman-lab
jeremy.freeman@mac.com
feross
feross@feross.org
emilbayes
github@tixz.dk
colingourlay
colin@colin-gourlay.com
jameskyburz
james.kyburz@gmail.com
almost
tom@almostobsolete.net
slaskis
robert@publicclass.se
ungoldman
ungoldman@gmail.com
graforlock
neatcube@gmail.com
tornqvist
carl@tornqv.ist
amongiants
jon@folderstudio.com
goto-bus-stop
npm@asdf.kooi.me
mafintosh
mathiasbuus@gmail.com