native-signal-ui
v0.3.4
Published
A super-simple signal-based UI framework based on my custom signal framework `native-signal`
Readme
signal-ui
A minimal, signal-based UI framework built around tagged template literals. No virtual DOM, but now with jsx instead of custom template strings.
Install
npm install native-signal-uiQuick start
own(value, ...owners)
native-signal retains subscribers via WeakRef. If your subscriber closure
isn't kept alive by anything else, GC will eventually collect it and the
signal will silently stop notifying. own() ties a value's lifetime to one or
more owner objects (without modifying them) so you don't have to invent a
field on every component just to hold onto a closure:
import { own } from "native-signal-ui";
const fn = (_, next) => { /* ... */ };
signal.subscribe(fn);
own(fn, root); // fn stays alive at least as long as root doesScripts
npm run build— produce ESM bundle +.d.tsfiles indist/npm test— run the vitest suitenpm run typecheck—tsc --noEmit
License
UNLICENSED for now — set this when publishing.
