joyent-portal/packages/my-joy-instances/src/state/global.js

21 lines
507 B
JavaScript
Raw Normal View History

import { canUseDOM } from 'exenv';
export default (() => {
if (!canUseDOM) {
2018-03-07 17:36:32 +02:00
return {
cookie: ''
};
}
return {
port: window.location.port,
protocol: window.location.protocol.replace(/:$/, ''),
hostname: window.location.hostname,
2018-03-06 03:14:33 +02:00
origin: window.location.origin,
2018-03-07 17:36:32 +02:00
cookie: document.cookie || '',
__REDUX_DEVTOOLS_EXTENSION__: window.__REDUX_DEVTOOLS_EXTENSION__,
__APOLLO_STATE__: window.__APOLLO_STATE__,
__REDUX_STATE__: window.__REDUX_STATE__
};
})();