@firsthandjs/core
The reactive graph, the owner tree and context. No DOM: this package must load
unchanged in a worker or on a server.
Documentation: guide · API reference · all docs
import { signal, computed, effect, batch, untrack } from '@firsthandjs/core';
const count = signal(0);
const doubled = computed(() => count.value * 2);
effect(() => console.log(doubled.value)); // logs 0
count.value = 21; // logs 42, synchronously
- Writes push invalidation; values are pulled lazily on read, which makes
diamond dependencies glitch-free without a topological sort.
- Dependency edges are reusable doubly-linked objects, so a re-run with stable
dependencies allocates nothing.
- Everything is owned: disposing a scope unlinks every edge in both directions.
Full documentation: the repository README,
ARCHITECTURE.md and docs/adr.
MIT licensed.