Skip to content

Commit

Permalink
Use convergent global (#2103)
Browse files Browse the repository at this point in the history
* chore: use convergent global

* fix: remove unused window
  • Loading branch information
doxiaodong authored and FredyC committed Sep 11, 2019
1 parent 8ee9365 commit 5c22dfb
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/mobx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,16 @@
*
*/

declare const window: any
import { getGlobal, spy, getDebugName, fail } from "./internal"

try {
// define process.env if needed
// if this is not a production build in the first place
// (in which case the expression below would be substituted with 'production')
// tslint:disable-next-line
process.env.NODE_ENV
} catch (e) {
const g = typeof window !== "undefined" ? window : global
const g = getGlobal()
if (typeof process === "undefined") g.process = {}
g.process.env = {}
}
Expand Down Expand Up @@ -152,8 +153,6 @@ export {
export const $mobx = "$mobx"

// Devtools support
import { spy, getDebugName, fail } from "./internal"

declare const __MOBX_DEVTOOLS_GLOBAL_HOOK__: { injectMobx: (any) => void }
if (typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__ === "object") {
// See: https://github.com/andykog/mobx-devtools/
Expand Down

0 comments on commit 5c22dfb

Please sign in to comment.