Skip to content

A minimum immplementation of EventSource for IE11 and Edge

License

Notifications You must be signed in to change notification settings

mattkrick/event-source-polyfill

Repository files navigation

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.

About

A minimum immplementation of EventSource for IE11 and Edge

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published