silmaril

Start

silmaril

silmaril

Compile-time reactivity for plain JS and TS.

$$ defines a reactive boundary. A variable declared inside it is reactive when it is written, reads another reactive variable or binds a store. $ reacts when such a variable changes. The compiler works out which code reads which variable, so a write runs only the code that reads the written variable.

index-overview.js

No logs.

Features

  • Compile-time reactivity. silmaril/compiler finds the reactive variables and the code that reads them.
  • Static reactive graph. A write runs only the code that reads the written variable.
  • Minimal runtime. silmaril has no dependencies and ships less than 1.5 kB gzipped.
  • Auto-memoization. A computed variable runs again only when a variable it reads changes.
  • Stores. $store binds any store with get and subscribe to a variable.

Where to go next

Inspirations and prior art

Sponsors

Sponsors

License

MIT, by lxsmnsyc. The source is on GitHub.