Skip to content

Commit

Permalink
fix: break cyclic dependency (#822)
Browse files Browse the repository at this point in the history
Fixes #820
  • Loading branch information
theKashey authored and gregberge committed Jan 25, 2018
1 parent 2f2e01f commit 328d793
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
5 changes: 1 addition & 4 deletions packages/react-hot-loader/src/reconciler/proxies.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
import createProxy, { setConfig } from 'react-stand-in'
import logger from '../logger'
import createProxy from 'react-stand-in'

let proxiesByID
let idsByType

let elementCount = 0

setConfig({ logger })

const generateTypeId = () => `auto-${elementCount++}`

export const getIdByType = type => idsByType.get(type)
Expand Down
8 changes: 5 additions & 3 deletions packages/react-hot-loader/src/utils.dev.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { getProxyByType } from './reconciler/proxies'
import reactHotLoader from './reactHotLoader'
import logger from './logger'
import { setConfig as setProxyConfig } from 'react-stand-in'

setProxyConfig({ logger })

export const areComponentsEqual = (a, b) =>
getProxyByType(a) === getProxyByType(b)

export const setConfig = config => {
Object.assign(reactHotLoader.config, config)
}
export const setConfig = config => Object.assign(reactHotLoader.config, config)

0 comments on commit 328d793

Please sign in to comment.