import React from 'react';
import ReactDOM from 'react-dom';
import Redux from 'redux'
import { Provider, } from 'react-redux';
import store from './store';
import App from './parts/app/App';
import { loadStationsAsync, loadStationStatusesAsync, } from './parts/stations/actions';

const
  rootComponent = React.createElement(Provider, { store, }, React.createElement(App)),
  rootElement = document.getElementById('root');

ReactDOM.render(rootComponent, rootElement);

store.dispatch(loadStationsAsync());
store.dispatch(loadStationStatusesAsync());

setInterval(() => store.dispatch(loadStationStatusesAsync()), 2000);
