1 var before = require('./before');
4 * Creates a function that is restricted to invoking `func` once. Repeat calls
5 * to the function return the value of the first invocation. The `func` is
6 * invoked with the `this` binding and arguments of the created function.
12 * @param {Function} func The function to restrict.
13 * @returns {Function} Returns the new restricted function.
16 * var initialize = _.once(createApplication);
19 * // => `createApplication` is invoked once
22 return before(2, func);
25 module.exports = once;