Yaffle / EventSource

a polyfill for http://www.w3.org/TR/eventsource/
MIT License
2.11k stars 338 forks source link

does EventSourcePolyfill contains onclose event #217

Closed jiangxiaoqiang closed 1 year ago

jiangxiaoqiang commented 1 year ago

how to known the message transfer complete or the connect close? I have tried this way seems did not work:

eventSource.addEventListener('complete', () => {
    console.log('Transfer of data is complete');
  });

  eventSource.addEventListener('onclose', () => {
    console.log('connection is closed');
  });
Yaffle commented 1 year ago

Event name should be close not onclose