@hashbrownai/react
Version:
React components for Hashbrown AI
14 lines (13 loc) • 386 B
TypeScript
type TeardownFn = () => void;
type HashbrownSignal<T> = {
(): T;
subscribe(onChange: (newValue: T) => void): TeardownFn;
};
/**
* Connects a Hashbrown Signal to React's reactivity system
*
* @param signal The signal to connect to React
* @returns The value contained in the signal
*/
export declare function useHashbrownSignal<T>(signal: HashbrownSignal<T>): T;
export {};