Skip to content

Commit

Permalink
Allow to use substanceGlobals in a worker.
Browse files Browse the repository at this point in the history
  • Loading branch information
obuchtala committed Nov 2, 2020
1 parent bafe597 commit 44fa14f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion util/substanceGlobals.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
/* global self */
import _isDefined from './_isDefined'

/**
A place to store global variables.
*/
const _global = (typeof global !== 'undefined') ? global : window
const _global = (typeof global !== 'undefined') ? global : (typeof window !== 'undefined') ? window : (typeof self !== 'undefined') ? self : undefined
const substanceGlobals = _isDefined(_global.Substance) ? _global.Substance : _global.Substance = {}
export default substanceGlobals

0 comments on commit 44fa14f

Please sign in to comment.