Use variable instead of function name.

This commit is contained in:
Antoine Vandecreme 2016-03-22 10:03:52 -04:00
parent d3b027bade
commit fddf0fb938

View File

@ -67,10 +67,11 @@ $.EventSource.prototype = {
*/ */
addOnceHandler: function(eventName, handler, userData) { addOnceHandler: function(eventName, handler, userData) {
var self = this; var self = this;
this.addHandler(eventName, function onceHandler(event) { var onceHandler = function(event) {
self.removeHandler(eventName, onceHandler); self.removeHandler(eventName, onceHandler);
handler(event); handler(event);
}, userData); };
this.addHandler(eventName, onceHandler, userData);
}, },
/** /**