MCPcopy Index your code
hub / github.com/choojs/nanoscheduler

github.com/choojs/nanoscheduler @v1.0.3

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.0.3 ↗ · + Follow
2 symbols 3 edges 2 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

nanoscheduler

npm version build status downloads js-standard-style

Schedule work to be completed when the user agent is idle. Weighs 270 bytes compressed.

Usage

var NanoScheduler = require('nanoscheduler')

var scheduler = NanoScheduler()
var i = 10000
while (i--) scheduler.push(() => console.log(`idle time! ${Date.now()}`))

Why?

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.

API

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.

Installation

$ npm install nanoscheduler

License

Apache-2.0

Core symbols most depended-on inside this repo

NanoScheduler
called by 1
index.js
createScheduler
called by 0
index.js

Shape

Function 2

Languages

TypeScript100%

Modules by API surface

index.js2 symbols

For agents

$ claude mcp add nanoscheduler \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page