cached()
Factory: cached(deps, fn) — like derived but skips fn() on disconnected get() when dep snapshots match. Pipe: cached(eq?) — output dedup + cached pull (similar to distinctUntilChanged + getter cache).
Signature
ts
function cached<T>(deps: Store<unknown>[], fn: () => T, opts?: StoreOptions<T>): Store<T>
function cached<A>(eq?: (a: A, b: A) => boolean): StoreOperator<A, A>Parameters
| Parameter | Type | Description |
|---|---|---|
args | any[] |
Returns
Store<T> or StoreOperator<A, A> depending on overload.