The reactive toolkit for the modern web.
Alwatr is a nano-package ecosystem for building fast, production-grade applications — starring the Flux family: Signals, Actions, Directives, Bind, and Storage, wired together by one strict, unidirectional data cycle.
import {createStateSignal, createComputedSignal, actionService} from '@alwatr/flux';
declare module '@alwatr/flux' {
interface ActionRecord {
ui_increment: void;
}
}
const count = createStateSignal({name: 'count', initialValue: 0});
const doubled = createComputedSignal({
name: 'doubled',
deps: [count],
get: () => count.get() * 2,
});
actionService.on('ui_increment', () => count.update((n) => n + 1));
actionService.setupDelegation();The Flux Family
One architecture, five primitives.
Every Flux primitive plugs into the same cycle: View → Action → Controller → State → View. Learn one, and the rest read like dialects of the same language.
Signals
Fine-grained, dependency-tracked reactivity — State, Computed, Effect, Event, and Channel — with zero virtual-DOM diffing.
Learn moreActions
One delegated listener per event type on document.body handles unlimited elements. A fully typed action bus, O(1) at any scale.
Learn moreDirectives
Attach reusable, self-cleaning TypeScript behavior to any element via a plain HTML attribute. No framework buy-in required.
Learn moreBind
Project domain state into a flat view model and bind it straight to text, values, attributes, and CSS variables — surgically.
Learn moreStorage
Persistent and session signals that debounce writes to localStorage/sessionStorage automatically, plus SSR-safe hydration.
Learn moreFinite State Machines
A tiny, type-safe statechart engine on top of Signals — guards, actors, and effects that eliminate ad-hoc boolean state.
Learn moreUnidirectional Data Flow
Data flows down. Intent flows up. Always.
Views never mutate state directly — they dispatch a typed action. Controllers never touch the DOM — they write to signals. It's a strict, zero-coupling cycle that keeps every layer independently testable and replaceable.
The Kit
A whole ecosystem, not just a framework.
Flux and FSM are the headline acts, but they sit on top of ~35 independent, dependency-free nanolib primitives — and are joined by backend-side siblings for the rest of your stack.
The UI & reactive bundle — signals, actions, directives, bind, storage.
@alwatr/fsmA type-safe, reactive finite state machine engine.
@alwatr/coreCross-platform utilities every project needs — Lazy, Logger, and more.
@alwatr/nanolibThe ~35 dependency-free micro-packages that everything else is built from.
@alwatr/nanotronA minimal-overhead micro API server framework for Bun/Node.
@alwatr/nitrobaseA blazingly fast, JSON-based in-memory database with file persistence.
Ship reactive UI without shipping a framework.
Install the kit, wire your first signal, and see the whole cycle click into place in a few minutes.