Skip to content

Commit

Permalink
Remove checks.
Browse files Browse the repository at this point in the history
  • Loading branch information
kinyoklion committed May 22, 2024
1 parent 2e3ad57 commit a718fa2
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions lib/eventsource.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,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 @@ -374,10 +372,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 a718fa2

Please sign in to comment.