All files / lib mount.js

72% Statements 18/25
50% Branches 4/8
66.67% Functions 2/3
60% Lines 3/5
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 343x                         3x                   6x                    
import React from 'react'
import {render} from 'react-dom'
import {Provider} from 'react-redux'
import {browserHistory} from 'react-router'
import {syncHistoryWithStore} from 'react-router-redux'
 
import createStore from './store'
 
if (process.env.NODE_ENV === 'development') {
  const Perf = window.Perf = require('react-addons-perf')
  Perf.start()
}
 
export function create ({
  app,
  reducers
}) {
  const store = createStore(reducers)
  const history = syncHistoryWithStore(browserHistory, store)
  return React.createElement(Provider, {store},
    React.createElement(app, {history}))
}
 
export default function mount ({I
  app,
  id = 'root',
  reducers
}) {
  return render(
    create({app, reducers}),
    document.getElementById(id)
  )
}