Sha256: fb43a280b25abd87bfe71a49e89fc93aa04f3aaf5aef5bb6b5496f969c3b7e3e

Contents?: true

Size: 665 Bytes

Versions: 274

Compression:

Stored size: 665 Bytes

Contents

var before = require('./before');

/**
 * Creates a function that is restricted to invoking `func` once. Repeat calls
 * to the function return the value of the first invocation. The `func` is
 * invoked with the `this` binding and arguments of the created function.
 *
 * @static
 * @memberOf _
 * @since 0.1.0
 * @category Function
 * @param {Function} func The function to restrict.
 * @returns {Function} Returns the new restricted function.
 * @example
 *
 * var initialize = _.once(createApplication);
 * initialize();
 * initialize();
 * // => `createApplication` is invoked once
 */
function once(func) {
  return before(2, func);
}

module.exports = once;

Version data entries

274 entries across 272 versions & 30 rubygems

Version Path
immosquare-cleaner-0.1.60 node_modules/lodash/once.js
immosquare-cleaner-0.1.59 node_modules/lodash/once.js
immosquare-cleaner-0.1.58 node_modules/lodash/once.js
immosquare-cleaner-0.1.57 node_modules/lodash/once.js
immosquare-cleaner-0.1.56 node_modules/lodash/once.js
immosquare-cleaner-0.1.55 node_modules/lodash/once.js
immosquare-cleaner-0.1.54 node_modules/lodash/once.js
immosquare-cleaner-0.1.53 node_modules/lodash/once.js
immosquare-cleaner-0.1.52 node_modules/lodash/once.js
trusty-cms-6.3.1 node_modules/lodash/once.js
immosquare-cleaner-0.1.51 node_modules/lodash/once.js
boring_generators-0.15.0 tmp/templates/app_template/node_modules/lodash/once.js
clapton-0.0.26 lib/clapton/javascripts/node_modules/lodash/once.js
clapton-0.0.25 lib/clapton/javascripts/node_modules/lodash/once.js
immosquare-cleaner-0.1.50 node_modules/lodash/once.js
clapton-0.0.24 lib/clapton/javascripts/node_modules/lodash/once.js
clapton-0.0.23 lib/clapton/javascripts/node_modules/lodash/once.js
clapton-0.0.22 lib/clapton/javascripts/node_modules/lodash/once.js
clapton-0.0.21 lib/clapton/javascripts/node_modules/lodash/once.js
clapton-0.0.20 lib/clapton/javascripts/node_modules/lodash/once.js