Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Break cyclic dependency #822

Merged
merged 1 commit into from
Jan 25, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)