3 ms·
Not OP, but if you're building a small scheduler for batching changes, it should be pretty straightforward: - `jobs` is an array of functions - enqueue adds a
by timfsu 4y ago
Not OP, but if you're building a small scheduler for batching changes, it should be pretty straightforward:
- `jobs` is an array of functions
- enqueue adds a job to `jobs` and starts running jobs if not running
- job running can be triggered by animation frames or setTimeout