The primitive: useSignal
This section is for library authors and for equals overrides.
This section is for library authors and for equals overrides. useSignal(value, options?) is the low-level cell that useStore builds single values on. It returns the same [read, write] pair, but it never wraps: an object you pass is one value, read as is. Application code uses useStore. Reach for useSignal in a hook you build on the extension API, or when you need an equals option, which useStore does not take.
- Equality is
Object.isunlessoptions.equalsis given (falsenotifies on every write, or a function(previous, next) => boolean). options.namelabels the signal in diagnostics.