Skip to content

Commit

Permalink
Update polyfill.
Browse files Browse the repository at this point in the history
  • Loading branch information
kinyoklion committed May 22, 2024
1 parent a718fa2 commit 8f5d4af
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions example/eventsource-polyfill.js
Original file line number Diff line number Diff line change
Expand Up @@ -7432,9 +7432,7 @@ function EventSource (url, eventSourceInitDict) {
event.delayMillis = delay
_emit(event)

if (reconnectTimer) {
clearTimeout(reconnectTimer)
}
clearTimeout(reconnectTimer)

reconnectTimer = setTimeout(function () {
if (readyState !== EventSource.CONNECTING) return
Expand Down Expand Up @@ -7611,10 +7609,8 @@ function EventSource (url, eventSourceInitDict) {
}

this._close = function () {
if (reconnectTimer) {
clearTimeout(reconnectTimer)
reconnectTimer = null
}
clearTimeout(reconnectTimer)

if (readyState === EventSource.CLOSED) return
readyState = EventSource.CLOSED

Expand Down

0 comments on commit 8f5d4af

Please sign in to comment.