From 3fe8c245682cad40dbbbff00e3699621f9686dad Mon Sep 17 00:00:00 2001 From: Adam Taylor Date: Thu, 14 Apr 2016 12:32:45 -0700 Subject: [PATCH] adds logic for different "global" variable names --- lib/global.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/global.js b/lib/global.js index ef76422..9e64e6a 100644 --- a/lib/global.js +++ b/lib/global.js @@ -3,7 +3,13 @@ var React = require('react'); var Global = React.createClass({ statics: { get: function(name) { - return window[name]; + if(typeof global !== 'undefined') { + return global[name]; + } else if(typeof window !== 'undefined') { + return window[name] + } else { + return null; + } } },