@signal-kernel/core
v0.1.1
Published
A minimal, deterministic, fine-grained reactivity engine.
Downloads
181
Maintainers
Readme
@signal-kernel/core
A minimal, deterministic, fine-grained reactivity engine.
Build reactive systems without frameworks — from UI adapters to async dataflow runtimes.
Think of this as a reactive runtime kernel, not a framework.
Installation
npm install @signal-kernel/coreQuick Start
import { signal, computed, createEffect } from "@signal-kernel/core";
const count = signal(0);
const doubled = computed(() => count.get() * 2);
createEffect(() => {
console.log("doubled =", doubled.get());
});
count.set(1);
count.set(2);Output:
doubled = 2
doubled = 4What is this?
@signal-kernel/core is a framework-agnostic reactive runtime.
It provides the minimal primitives needed to build reactive systems:
signal()— mutable statecomputed()— lazy derived valuescreateEffect()— reactive side effectsbatch()— update coalescing- deterministic scheduler
Unlike frameworks (React, Vue), this library:
- does not render UI
- does not manage DOM
- focuses purely on reactive dataflow and execution order
When to use this
Use @signal-kernel/core if you need:
Fine-grained reactivity (no VDOM diffing)
Deterministic update ordering
A foundation for building:
- UI adapters (React/Vue/Solid)
- async data pipelines
- reactive state machines
- server-side reactive graphs
This is not a UI framework — it is a low-level reactive kernel.
Core Concepts
signal()
const count = signal(0);
count.get();
count.peek();
count.set(1);computed()
const doubled = computed(() => count.get() * 2);createEffect()
createEffect(() => {
console.log(count.get());
});batch()
batch(() => {
count.set(1);
count.set(2);
});Scheduler Model
This runtime uses a two-phase deterministic scheduler:
- Recompute all stale computed nodes
- Execute all effects
→ Guarantees stable and predictable execution order.
Architecture Overview
For full details, see:
Public API
export { signal } from "./signal.js";
export { computed } from "./computed.js";
export { createEffect, onCleanup } from "./effect.js";
export { batch } from "./scheduler.js";Design Goals
- Deterministic scheduling
- Lazy computation
- Explicit dependency graph
- Zero framework assumptions
- Adapter-friendly architecture
Ecosystem
@signal-kernel/core is the foundation of the Signal Kernel ecosystem.
Future packages:
- async runtime
- framework adapters
License
MIT © Luciano
