dirtytalk
Dirty-tracking primitives
Only redraw
what's dirty.
Mark what changed once, at the source. dirtytalk coalesces the marks, tells only the subscribers who care, and flushes when the scheduler says so.
After a mutation
- 01
What changed?
Space
A Space defines what a region is in your domain: a set of keys, a path, a rect. Marks union into one dirty region. - 02
Who cares?
subscribe
Each subscriber declares an interest region. On flush, only subscribers whose interest intersects the dirty region are told. - 03
When do we tell them?
Scheduler
A Scheduler picks the moment: synchronously, at the end of the microtask, on the next animation frame, or when you pump.
Three packages
One algebra.
Two spaces built on it.
@dirtytalk/engine Engine
The algebra. Mark, coalesce, flush.
Space-agnostic dirty channel and schedulers.
Watch it run → 02@dirtytalk/structural Structural
Paths light up. Only their readers wake.
Path-based dirty tracking for state trees.
Watch it run → 03@dirtytalk/spatial Spatial
Rects of damage. Repaint just those.
Rect-based dirty tracking for scene graphs.
Watch it run →Install
$ pnpm add @dirtytalk/engine
$ pnpm add @dirtytalk/structural @dirtytalk/engine
$ pnpm add @dirtytalk/spatial @dirtytalk/engine Pick what you need. structural and spatial build on engine.