UNPKG

ts-prime

Version:

A utility library for JavaScript and Typescript.

13 lines 455 B
/** * 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 P.once(fn) * @example * const initialize = P.once(createApplication); * initialize(); * initialize(); * // => `createApplication` is invoked once * @category Function */ export declare function once<T>(fn: () => T): () => T; //# sourceMappingURL=once.d.ts.map