Schedule an event callback that will execute once, then unsubscribe
itself.
@method _oneTimeCallback
@param o {EventProvider} Object to attach the event to
@param evt {string} Name of the event
@param fn {Function} function to execute once
@private
6821
function (o,evt,fn) {
        var sub = function () {
            // Unsubscribe myself
            o.unsubscribe(evt, sub);
            // Pass the event handler arguments to the one time callback
            fn.apply({},arguments);
        };
        o.subscribe(evt,sub);
    }
257989
function(evt, callback) {
			if($.isUndefined(evt) || !$.isFunction(callback)) {
				return this;
			}

			var list = this.list[evt];
			if(!list) {
				return this;
			}
			var uuid = this._cbMap[callback];
			var handlers = list.handlers;
			var len = handlers.length;

			while(len--) {
				if(uuid === handlers[len]) {
					handlers.splice(len, 1);
					break;
				}
			}

			delete this._cbMap[callback];

			return this;
		}
987133
function (el, selector, ev, callback) {
        canEvent.on.call(el, ev, selector, callback);

		return function () {
            canEvent.off.call(el, ev, selector, callback);
		};
	}
1255159
function _runCallback(eventName, data) {
      for (var id in _mappings[eventName].callbacks) {
        var callbackObject = _mappings[eventName].callbacks[id];

        if (typeof callbackObject.cb === 'function') callbackObject.cb(data);
        if (typeof callbackObject.once === 'boolean' && callbackObject.once === true) _self.off(eventName, callbackObject.cb);
      }
    }
1330355
function (evt, callback) {
    if (!evt || !_.isObject(evt)) {
      var err = new Error('Please pass a valid event!');
      debug(err);
      throw err;
    }

    if (!callback || !_.isFunction(callback)) {
      var err = new Error('Please pass a valid callback!');
      debug(err);
      throw err;
    }

    var target = this.getTargetInformation(evt);

    var viewBuilders = this.tree.getViewBuilders(target);

    var errs = [];
    var notifications = [];

    var foundPrioSet = _.find(viewBuilders, function (vb) {
      return vb.priority < Infinity;
    });

    var eachMethod = 'each';
    if (foundPrioSet) {
      eachMethod = 'eachSeries';
    }

    async[eachMethod].call(async, viewBuilders, function (viewBuilder, callback) {
      viewBuilder.denormalize(evt, function (err, notis) {
        if (err) {
          debug(err);
          if (!errs.push) {
            var warn = new Error('ATTENTION! Already called back!');
            debug(warn);
            console.log(warn.stack);
            return;
          }
          errs.push(err);
        }

        if (notis && notis.length > 0) {
          notifications = notifications.concat(notis);
        }
        callback(null);
      });
    }, function () {
      if (errs.length === 0) {
        errs = null;
      }
      callback(errs, _.filter(notifications, function (n) { return !!n; }));
    });
  }
801888
function reorderEvents( node, eventName ) {
		if( node.addEventListener || !node.shoestringData || !node.shoestringData.events ) {
			// add event listner obviates the need for all the callback order juggling
			return;
		}

		var otherEvents = node.shoestringData.events[ eventName ] || [];
		for( var j = otherEvents.length - 1; j >= 0; j-- ) {
			// DOM Events only, Custom events maintain their own order internally.
			if( !otherEvents[ j ].isCustomEvent ) {
				node.detachEvent( "on" + eventName, otherEvents[ j ].callback );
				node.attachEvent( "on" + eventName, otherEvents[ j ].callback );
			}
		}
	}
865958
function once(fn/*: Function*/) /*: Function*/ {
    if (typeof fn !== 'function') {
        throw new TypeError('Expected a function');
    }
    return function(...args) {
        let result;
        if (fn) {
            result = fn.apply(this, args);
            fn = undefined;
        }
        return result;
    }
}
168888
function onRemove(el, fn) {
  var observer = new MutationObserver(this.createRemoveNodeHandler(el, fn));

  observer.observe(el.parentNode, {childList: true});
}
881340
function (evt, callback) {
    var self = this;

    this.executeDenormFnForEach(evt, function (err, res) {
      if (err) {
        debug(err);
        return callback(err);
      }

      async.each(res, function (item, callback) {
        if (item.id) {
          return callback(null);
        }
        self.collection.getNewId(function (err, newId) {
          if (err) {
            return callback(err);
          }
          item.id = newId;
          callback(null);
        });
      }, function (err) {
        if (err) {
          debug(err);
          return callback(err);
        }

        async.map(res, function (item, callback) {
          self.loadViewModel(item.id, function (err, vm) {
            if (err) {
              return callback(err);
            }

            self.handleOne(vm, evt, item, function (err, notification) {
              if (err) {
                return callback(err);
              }

              callback(null, notification);
            });
          });
        }, function (err, notis) {
          if (err) {
            debug(err);
            return callback(err);
          }

          callback(null, notis);
        });
      });
    });
  }
902398
function once(event, listener) {
  function g() {
    this.removeListener(event, g);
    listener.apply(this, arguments);
  };
  this.on(event, g);
  return this;
}
1350566
function (fn) {
            if (domReady) {
                try {
                    fn(S);
                } catch (e) {
                    setTimeout(function () {
                        throw e;
                    }, 0);
                }
            } else {
                callbacks.push(fn);
            }
            return this;
        }
744940
function Listener(handler, once) {
  assert(typeof handler === 'function', '`handler` must be a function.');
  assert(typeof once === 'boolean', '`once` must be a function.');
  this.handler = handler;
  this.once = once;
}
741678
function(name, callback, context) {
    if (eventsApi(this, 'replyOnce', name, [callback, context])) {
      return this;
    }

    var self = this;

    var once = _.once(function() {
      self.stopReplying(name);
      return makeCallback(callback).apply(this, arguments);
    });

    return this.reply(name, once, context);
  }
954126
def on(self, evt, func):
        ''''''
        if evt not in self._callbacks:
            raise NotImplementedError('callback "%s"' % evt)
        else:
            self._callbacks[evt] = func
1278403
function(evt) {
        this.timerId = window.setTimeout(
            OpenLayers.Function.bind(this.delayedCall, this, evt),
            this.delay
        );
    }
1143501
def once(self, event, callback):
        ''
        self._once_events.add(event)
        self.on(event, callback)
765762
function off(name, fn, elem) {
  var useCapture = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;

  return (elem || doc).removeEventListener(name, fn, useCapture);
}