@mattkrick/event-source-polyfill
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

event-source-polyfill

EventSource polyfill for IE11 and Edge. Fully spec compliant: https://html.spec.whatwg.org/multipage/server-sent-events.html

Why?

Because no other polyfill follows the spec.

What's it do?

The exact same thing that a minimum implementation of EventSource does. No more, no less. For SSE that implements a heartbeat, see https://github.com/mattkrick/trebuchet-client/

Installation

yarn add @mattkrick/event-source-polyfill @mattkrick/event-target-polyfill

import EventTargetPolyfill from '@mattkrick/event-target-polyfill'
import EventSourcePolyfill from '@mattkrick/event-source-polyfill'

window.EventTarget = EventTargetPolyfill
window.EventSource = EventSourcePolyfill

NOTE: Make sure your browser supports EventTarget! If it doesn't use that polyfill, too.

/@mattkrick/event-source-polyfill/

    Package Sidebar

    Install

    npm i @mattkrick/event-source-polyfill

    Weekly Downloads

    17

    Version

    0.1.0

    License

    MIT

    Unpacked Size

    297 kB

    Total Files

    13

    Last publish

    Collaborators

    • mattkrick