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) {
var self = this;
this.addHandler(eventName, function onceHandler(event) {
var onceHandler = function(event) {
self.removeHandler(eventName, onceHandler);
handler(event);
}, userData);
};
this.addHandler(eventName, onceHandler, userData);
},
/**