import { Derived } from './derive.function'; /** * Subscribes a React component to a value created with {@link derive}. * * ```tsx * import { adapt, derive, useDerived } from '@state-adapt/react'; * * const priceStore = adapt(20); * const quantityStore = adapt(3); * * const deriveTotal = derive(() => priceStore() * quantityStore()); * * function Total() { * const total = useDerived(deriveTotal); * * return

Total: {total}

; * } * ``` * * `deriveTotal` is computed once per change, no matter how many components * subscribe. */ export declare function useDerived(derived: Derived): Value;