Lazy Evaluation
Signals push notifications, derived values pull updates. All parts of the system are kept in sync lazily—changing a signal doesn't trigger computations, it simply tells dependents they'll need to recompute eventually.
Composable, performant primitives for building reactive programs simply
import { createSignal, createDerived, createEffect } from '@signalis/core';
const count = createSignal(0);
const doubled = createDerived(() => count.value * 2);
createEffect(() => {
console.log(`Count: ${count.value}, Doubled: ${doubled.value}`);
});
// Logs immediately: "Count: 0, Doubled: 0"
count.value = 5; // Logs: "Count: 5, Doubled: 10"Signals are the foundation—a box around a value that tells other things when it has changed. Read and write via .value.
Derived values are readonly reactive computations. They're lazy and smart about recomputation, only updating when accessed and when their dependencies actually change.
Effects are reactive functions for side effects. They run eagerly (not lazy) and can return cleanup functions for disposal.
Signalis is influenced by @preact/signals, SolidJS, and reactively.