All files / javascripts/explorev2 index.jsx

0% Statements 0/13
100% Branches 0/0
100% Functions 0/0
0% Lines 0/13
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                                                                 
import React from 'react';
import ReactDOM from 'react-dom';
import ExploreViewContainer from './components/ExploreViewContainer';
import { createStore, applyMiddleware, compose } from 'redux';
import { Provider } from 'react-redux';
import thunk from 'redux-thunk';
 
import { initialState } from './stores/store';
 
const exploreViewContainer = document.getElementById('js-explore-view-container');
const bootstrapData = JSON.parse(exploreViewContainer.getAttribute('data-bootstrap'));
 
import { exploreReducer } from './reducers/exploreReducer';
 
const bootstrappedState = Object.assign(initialState, {
  can_download: bootstrapData.can_download,
  datasources: bootstrapData.datasources,
  datasource_id: parseInt(bootstrapData.datasource_id, 10),
  datasource_type: bootstrapData.datasource_type,
  viz: bootstrapData.viz,
});
const store = createStore(exploreReducer, bootstrappedState,
  compose(applyMiddleware(thunk))
);
 
ReactDOM.render(
  <Provider store={store}>
    <ExploreViewContainer />
  </Provider>,
  exploreViewContainer
);