You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
es=newEventSource(url,{debug: debug,headers: headers,pollingInterval: 0,// Set pollingInterval to 0 to disable reconnections})
I set pollingInterval to 0 as suggested in the README because otherwise it would reconnect and I don't need reconnections. However, I do want to know when the request "finishes".
The server closing does not trigger a close event, which seems to be by design. But I noticed [EventSource][onreadystatechange][DONE] Operation done. in the debug logs. That is exactly what I need to know in my code, but there's no event!
I forked the source locally, added the event, and things work perfectly 👌. The actual change is only a handful of lines, so I can easily make a PR. Just wanted to get a 👍 first.
The text was updated successfully, but these errors were encountered:
Thanks in advance! My usage looks like this.
I set
pollingInterval
to0
as suggested in the README because otherwise it would reconnect and I don't need reconnections. However, I do want to know when the request "finishes".The server closing does not trigger a
close
event, which seems to be by design. But I noticed[EventSource][onreadystatechange][DONE] Operation done.
in the debug logs. That is exactly what I need to know in my code, but there's no event!I forked the source locally, added the event, and things work perfectly 👌. The actual change is only a handful of lines, so I can easily make a PR. Just wanted to get a 👍 first.
The text was updated successfully, but these errors were encountered: