Skip to content

Commit

Permalink
Merge pull request #80 from neftaly/polyfill
Browse files Browse the repository at this point in the history
Improve polyfill
  • Loading branch information
rexxars committed Jul 18, 2017
2 parents a622b07 + 92e4795 commit 42805b9
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lib/eventsource-polyfill.js
@@ -1,2 +1,9 @@
window.EventSourcePolyfill = require('./eventsource')
window.EventSource = window.EventSource || window.EventSourcePolyfill
var EventSource = require('./eventsource')

if (typeof window === 'object') {
window.EventSourcePolyfill = EventSource
if (!window.EventSource) window.EventSource = EventSource
module.exports = window.EventSource
} else {
module.exports = EventSource
}

0 comments on commit 42805b9

Please sign in to comment.