Skip to content
This repository was archived by the owner on Apr 15, 2023. It is now read-only.
This repository was archived by the owner on Apr 15, 2023. It is now read-only.

Difference between original EventSource #9

@ddavydov

Description

@ddavydov

These is one important difference between with original EventSource
https://github.com/remy/polyfills/blob/master/EventSource.js#L95

        // don't need to poll again, because we're long-loading
        } else if (eventsource.readyState !== eventsource.CLOSED) {
          if (this.readyState == 4) { // and some other status
            // dispatch error
            eventsource.readyState = eventsource.CONNECTING;
            eventsource.dispatchEvent('error', { type: 'error' });
            pollAgain(interval);
          } else if (this.readyState == 0) { // likely aborted
            pollAgain(interval);
          } else {
          }
        }

code related to // dispatch error was not moved intentionally? In my case it's needed to catch error codes from the server.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions