DieselDepot-APP/node_modules/es-toolkit/dist/function/once.d.ts
SJCoetz def597c157 chore: add generated build artifacts and node module type files
add all Next.js build outputs and third-party dependency type declaration files
2026-07-20 01:18:42 +02:00

18 lines
No EOL
557 B
TypeScript

//#region src/function/once.d.ts
/**
* Creates a function that is restricted to invoking func once. Repeat calls to the function return the value of the first invocation.
*
* @template F - The type of the function.
* @param func - The function to restrict.
* @returns Returns the new restricted function.
*
* @example
* const initialize = once(createApplication);
*
* initialize();
* initialize();
* // => `createApplication` is invoked once
*/
declare function once<F extends (...args: any[]) => any>(func: F): F;
//#endregion
export { once };