import { useMemo } from 'react'; import type { IGridReactiveValue, IGridReactiveValueSubscribe } from './IGridReactiveValue.js'; type NoInfer = intrinsic; export function useCreateGridReactiveValue( get: (...args: TArgs) => T, subscribe: NoInfer> | null, deps: React.DependencyList, ): IGridReactiveValue { const value = useMemo>( () => ({ get, subscribe: subscribe ?? (() => () => {}), }), deps, ); return value; }