remeda
Version:
A utility library for JavaScript and Typescript.
17 lines • 518 B
text/typescript
//#region src/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.
*
* @param fn - The function to wrap.
* @signature R.once(fn)
* @example
* const initialize = R.once(createApplication);
* initialize();
* initialize();
* // => `createApplication` is invoked once
* @category Function
*/
declare function once<T>(fn: () => T): () => T;
//#endregion
export { once };
//# sourceMappingURL=once-kBAn1lK1.d.cts.map