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.
11 * @param {Function} func The function to restrict.
12 * @returns {Function} Returns the new restricted function.
15 * var initialize = _.once(createApplication);
18 * // `initialize` invokes `createApplication` once
21 return before(2, func);
24 module.exports = once;