Core concepts
Signals & state
Small primitives. Connected state. A reactive graph that follows the values your interface actually reads.
Browse documentation
Start with a value
Signals.signal(initialValue) returns a WritableSignal<T>. Read it with get(), replace it with set(), or derive its next value with update(). Templates read a signal using function-call syntax.
public final WritableSignal<Integer> count = Signals.signal(0);
public void increment() {
count.update(value -> value + 1);
}
public void reset() {
count.set(0);
}
Let derived state follow
Signals.computed(supplier) produces a read-only Signal<T>. It tracks the signals read during the calculation and recomputes lazily when needed. Dependencies are rebuilt on each run, so conditional reads naturally change what it observes.
public final WritableSignal<Integer> count = Signals.signal(0);
public final Signal<Integer> doubled =
Signals.computed(() -> count.get() * 2);
Effects and linked state
Signals.effect runs side effects through a scheduler. Effects created in component constructors or lifecycle hooks belong to the page and run before views during the next tick. A cleanup registrar can release resources between runs or at destruction.
Signals.linkedSignal derives a writable value from another signal. Signals.untracked reads without adding dependencies. Input, model, and output primitives are available through Signals.input(), inputRequired(), model(), and output().
public CounterComponent() {
Signals.effect(() -> {
System.out.println("Count is " + count.get());
});
}
Respect page ownership
Signals created in a page turn remember that page. Write them from event handlers, lifecycle work, or Zone-managed continuations. A write from an unrelated thread throws SignalWriteOutsideTurnException.
Default equality is Java’s Objects.equals, which works naturally with records and value collections. Angular uses identity equality. Pass Equality.identity() when that behavior is needed. Do not write signals from a computed calculation.