{"size": 918, "ext": "js", "max_stars_repo_path": "src/index.js", "max_stars_repo_name": "senbonsakura/WeatherApp", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/index.js", "max_issues_repo_name": "senbonsakura/WeatherApp", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/index.js", "max_forks_repo_name": "senbonsakura/WeatherApp", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 30.6, "max_line_length": 97, "alphanum_fraction": 0.7222222222}
import React from 'react';
import ReactDOM from 'react-dom';
import { Provider } from 'react-redux';
import { createStore, applyMiddleware } from 'redux';
import thunkMiddleware from 'redux-thunk'
import { createLogger } from 'redux-logger'
import App from './components/app';
import reducers from './reducers';
const loggerMiddleware = createLogger()
import { saveState } from './localStorage';
import throttle from 'lodash/throttle';
const createStoreWithMiddleware = applyMiddleware(thunkMiddleware,loggerMiddleware)(createStore);
const store = createStoreWithMiddleware(reducers);
store.subscribe(throttle(()=> {
  const weather = store.getState().weather.weather;
  saveState(weather &&{
    cities: weather.map((city) =>({
      name:city.city.name,
      id:city.city.id,
    }) )
  })
},1000));


ReactDOM.render(
  <Provider store={store}>
    <App />
  </Provider>
  , document.querySelector('.container'));
