https://github.com/mattkrick/event-source-polyfill
A minimum immplementation of EventSource for IE11 and Edge
https://github.com/mattkrick/event-source-polyfill
Last synced: about 1 month ago
JSON representation
A minimum immplementation of EventSource for IE11 and Edge
- Host: GitHub
- URL: https://github.com/mattkrick/event-source-polyfill
- Owner: mattkrick
- License: mit
- Created: 2018-08-20T20:38:04.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-08-20T20:39:53.000Z (almost 7 years ago)
- Last Synced: 2025-03-08T09:33:59.548Z (3 months ago)
- Language: TypeScript
- Size: 52.7 KB
- Stars: 15
- Watchers: 4
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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`
```js
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.