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

  1. 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.

  2. 02

    Who cares?

    subscribe
    Each subscriber declares an interest region. On flush, only subscribers whose interest intersects the dirty region are told.

  3. 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.

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.