Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions reconnecting-websocket.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,8 @@
* @param args Object an optional object that the event will use
*/
function generateEvent(s, args) {
var evt = document.createEvent("CustomEvent");
evt.initCustomEvent(s, false, false, args);
return evt;
};
return new CustomEvent(s, { detail: args });
}

this.open = function (reconnectAttempt) {
ws = new WebSocket(self.url, protocols || []);
Expand Down