@winglet/react-utils
Version:
React utility library providing custom hooks, higher-order components (HOCs), and utility functions to enhance React application development with improved reusability and functionality
12 lines (11 loc) • 462 B
TypeScript
import type { Fn } from '../@aileron/declare';
/**
* Returns a constant value. If the input is a function, executes it and stores the result.
* The value is computed only once during the component's lifetime.
* @param input - A constant value or a function that returns a value
* @returns The constant value or the result of the function execution
*/
export declare const useConstant: {
<Return>(input: Fn<[], Return>): Return;
<T>(input: T): T;
};