CoolFace
Datasetpublic

basant307/AI_Governance_Project

sourceHugging Faceapache-2.0updated 2mo agoView on Hugging Face
0likes48downloads
once.js26 linesDownload Raw Back to lodash-es
1import before from './before.js';2 3/**4 * Creates a function that is restricted to invoking `func` once. Repeat calls5 * to the function return the value of the first invocation. The `func` is6 * invoked with the `this` binding and arguments of the created function.7 *8 * @static9 * @memberOf _10 * @since 0.1.011 * @category Function12 * @param {Function} func The function to restrict.13 * @returns {Function} Returns the new restricted function.14 * @example15 *16 * var initialize = _.once(createApplication);17 * initialize();18 * initialize();19 * // => `createApplication` is invoked once20 */21function once(func) {22  return before(2, func);23}24 25export default once;26 
basant307/AI_Governance_Project · CoolFace