Skip to content

Commit

Permalink
Move canUseDOM in with DOMUtils
Browse files Browse the repository at this point in the history
  • Loading branch information
mjackson committed Feb 26, 2017
1 parent f009c7a commit 785f2e5
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 9 deletions.
4 changes: 4 additions & 0 deletions modules/DOMUtils.js
@@ -1,3 +1,7 @@
export const canUseDOM = !!(
typeof window !== 'undefined' && window.document && window.document.createElement
)

export const addEventListener = (node, event, listener) =>
node.addEventListener
? node.addEventListener(event, listener, false)
Expand Down
3 changes: 0 additions & 3 deletions modules/ExecutionEnvironment.js

This file was deleted.

3 changes: 1 addition & 2 deletions modules/__tests__/BrowserHistory-test.js
@@ -1,6 +1,5 @@
import createHistory from '../createBrowserHistory'
import { canUseDOM } from '../ExecutionEnvironment'
import { supportsHistory } from '../DOMUtils'
import { canUseDOM, supportsHistory } from '../DOMUtils'
import * as TestSequences from './TestSequences'

const canUseHistory = canUseDOM && supportsHistory()
Expand Down
3 changes: 1 addition & 2 deletions modules/__tests__/HashHistory-test.js
@@ -1,6 +1,5 @@
import createHistory from '../createHashHistory'
import { canUseDOM } from '../ExecutionEnvironment'
import { supportsGoWithoutReloadUsingHash } from '../DOMUtils'
import { canUseDOM, supportsGoWithoutReloadUsingHash } from '../DOMUtils'
import * as TestSequences from './TestSequences'

const describeHistory = canUseDOM ? describe : describe.skip
Expand Down
2 changes: 1 addition & 1 deletion modules/createBrowserHistory.js
Expand Up @@ -9,8 +9,8 @@ import {
createPath
} from './PathUtils'
import createTransitionManager from './createTransitionManager'
import { canUseDOM } from './ExecutionEnvironment'
import {
canUseDOM,
addEventListener,
removeEventListener,
getConfirmation,
Expand Down
2 changes: 1 addition & 1 deletion modules/createHashHistory.js
Expand Up @@ -10,8 +10,8 @@ import {
createPath
} from './PathUtils'
import createTransitionManager from './createTransitionManager'
import { canUseDOM } from './ExecutionEnvironment'
import {
canUseDOM,
addEventListener,
removeEventListener,
getConfirmation,
Expand Down

0 comments on commit 785f2e5

Please sign in to comment.