useSignal
useSignal(initialValue, options?) is render-only and returns one stable
WritableSignal owned by the current
component hook slot. Its graph edges and writer ownership are released when the
component identity disappears.
See Use signals and animation.
Related types: WritableSignal
and SignalOptions.
API details from source
Section titled “API details from source”
Creates one component-owned writable signal identity for a hook slot.
useSignal: <T>(initialValue: T, options?: SignalOptions<T>) => WritableSignal<T>Related API: useSignal, SignalOptions, WritableSignal.
Parameters
Section titled “Parameters”-
initialValue— Value stored when this hook slot is first created. -
options— Equality comparison and optional diagnostic name. See SignalOptions.
Returns
Section titled “Returns”A stable mount-owned writable signal. See WritableSignal.
See also
Section titled “See also”View source — packages/core/src/lib/hooks/use-signal.ts:15
Implementation guidance for agents
Section titled “Implementation guidance for agents”Read the Authoring, signals, and lifecycle companion for ownership, adaptation, failure modes, and verification. Agent start provides the version-selection workflow.
Complete minimal examples
Section titled “Complete minimal examples”- Component-owned state and reactions: Click to update a signal, derive a value, and publish an imperative effect after commit. Plain source
Interactive examples
Section titled “Interactive examples”- Signals and animation · Full page
- Reusable physics panels · Full page
- Living Ink · Full page
- Material Lab · Full page
- Growing Reveal · Full page
- Underwater scene · Full page
- Energy Transitions · Full page
- Optional filters · Full page
Documentation version
Section titled “Documentation version”Documentation built with @pibbl/core 0.0.2, revision 2dccb19. ALPHA — NOT FOR PRODUCTION USE.