Effect v4 Atom Solid API
Import Atom and AtomRef from Effect v4 core, and import Solid bindings from @effect/atom-solid.
Atom hooks
Section titled “Atom hooks”Atom and AtomRef selection hooks accept lazy thunks where their signatures below show one, allowing them to track the selected source within Solid’s reactive ownership model. useAtomInitialValues is different: it receives the iterable directly.
useAtom
Section titled “useAtom”Subscribes to a writable atom and returns a reactive accessor with a setter.
useAtomValue
Section titled “useAtomValue”Subscribes to an atom and optionally derives a value.
useAtomSet
Section titled “useAtomSet”Returns a setter without subscribing to the atom value.
useAtomSubscribe
Section titled “useAtomSubscribe”Subscribes a callback to atom changes.
useAtomMount and useAtomRefresh
Section titled “useAtomMount and useAtomRefresh”useAtomInitialValues
Section titled “useAtomInitialValues”Seeds the first value supplied for each atom in the current registry.
useAtomResource
Section titled “useAtomResource”Converts an AsyncResult atom into a Solid resource. It also accepts Solid resource options and suspendOnWaiting.
AtomRef hooks
Section titled “AtomRef hooks”useAtomRef
Section titled “useAtomRef”useAtomRefProp
Section titled “useAtomRefProp”Returns an accessor containing the derived property ref.
useAtomRefPropValue
Section titled “useAtomRefPropValue”Registry context
Section titled “Registry context”RegistryProvider creates and disposes an AtomRegistry for a Solid subtree. It accepts initial values and optional scheduling and lifetime settings. RegistryContext exposes the current registry for lower-level integrations.