UNPKG

@2toad/reflex

Version:

A simple approach to state management

11 lines 672 B
import { Reflex, ComputeFunction } from "./types"; /** * Creates a computed reactive value that depends on other reactive values. * The computed value automatically updates when any of its dependencies change. * * @param dependencies - Array of reflex values this computation depends on * @param compute - Function that computes the result from the current dependency values * @returns A read-only reflex value that updates automatically when dependencies change */ export declare function computed<TDeps extends Reflex<unknown>[], TResult>(dependencies: [...TDeps], compute: ComputeFunction<TDeps, TResult>): Reflex<TResult>; //# sourceMappingURL=computed.d.ts.map