Current File : /home/tradevaly/www/node_modules/contra/once.js
'use strict';

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

module.exports = function once (fn) {
  var disposed;
  function disposable () {
    if (disposed) { return; }
    disposed = true;
    (fn || noop).apply(null, arguments);
  }
  disposable.discard = function () { disposed = true; };
  return disposable;
};