-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex-polyfill.js
28 lines (25 loc) · 995 Bytes
/
index-polyfill.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
require('core-js/shim')
if (typeof window !== 'undefined') {
if (typeof window.Rx !== 'undefined') {
// Insert helpful warning here
} else {
// In polyfill version we expose Rx, as users generally want to use the
// same Rx as the library itself -- for example `Rx.Observable.empty()`
window.Rx = require('rx')
}
if (typeof window.eio !== 'undefined') {
// Insert helpful warning here
} else {
if (window.document) { // eslint-disable-line no-lonely-if
// In polyfill version we also expose eio for now. This is mostly so that
// we remember that eio can be omitted from the build if the user wants
// to use only websockets.
window.eio = require('engine.io-client/engine.io.js')
} else {
// This becomes `window.eio = window.eio` due to externals in webpack config,
// so that it is not bundled to non-polyfilled version.
window.eio = require('engine.io-client')
}
}
}
module.exports = require('./index')