[]previous and next page

The primitive: useSignal

This section is for library authors and for equals overrides.

For agentsUpdated

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.is unless options.equals is given (false notifies on every write, or a function (previous, next) => boolean).
  • options.name labels the signal in diagnostics.