All files / src mount.js

77.27% Statements 17/22
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 313x               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'
 
export function create ({
  app,
  reducers
}) {
  const store = createStore(reducers)
  const history = process.env.NODE_ENV !== 'test'
    ? syncHistoryWithStore(browserHistory, store)
    : {}
  return React.createElement(Provider, {store},
    React.createElement(app, {history, store}))
}
 
export default function mount ({
  app,
  id = 'root',
  reducers
}) {
  return render(
    create({app, reducers}),
    document.getElementById(id)
  )
}