Advanced / Store Advanced

deep

Returns a plain (non-proxy) deep copy and subscribes the current tracking scope to every nested change in the source store. Any write anywhere in the subtree invalidates the consumer.

Use this when you need plain data inside a reactive scope and want to react to deep mutations (e.g. Passing a snapshot to reconcile() or to a memo that should rerun on any nested change). For most read paths, prefer direct property access — Solid stores already track per-property reads with no deep() wrapper needed.


Import

import { deep } from "solid-js";

Type signature

function deep<T extends object>(store: T): T;

Examples

const [state] = createStore({ a: { b: { c: 1 } } });
createEffect(
() => deep(state), // reruns on any nested change
(plain) => sendToWorker(plain) // worker gets a non-proxy copy
);
Last updated: 7/4/26, 6:21 PMEdit this pageReport an issue with this page