1
0
mirror of https://github.com/mgerb/mywebsite synced 2026-01-11 18:32:50 +00:00

getting ready to ship

This commit is contained in:
2016-09-18 17:13:21 +00:00
parent 11a91412c1
commit 87d941804a
14 changed files with 66 additions and 27 deletions

View File

@@ -96,9 +96,14 @@ export function fetchSensorInfoMonth(location, year, month){
}
}
//this is called to initialize the sensor info page
//reloads unique dates and resets indexes
//then fetches new data for chart
export function fetchUniqueDates(location){
return (dispatch) => {
dispatch(fetchingUniqueDates());
dispatch(setSelectedMonthIndex(0));
dispatch(setSelectedYearIndex(0));
return fetch(`/api/uniquedates/${location}`)
.then(response => response.json())
.then(json => {

View File

@@ -6,7 +6,10 @@ import {syncHistoryWithStore} from 'react-router-redux';
import reducers from './reducers/reducers';
const middleware = applyMiddleware(thunk, logger());
const debug = process.env.NODE_ENV !== "production";
//run redux logger if we are in dev mode
const middleware = debug ? applyMiddleware(thunk, logger()) : applyMiddleware(thunk);
//create the new store with default state as an empty object
const store = createStore(reducers, {}, middleware);