Skip to content
This repository has been archived by the owner on Feb 19, 2024. It is now read-only.

Commit

Permalink
Refactor Reducers exports and add missing map reducer to store initia…
Browse files Browse the repository at this point in the history
…lizer

Signed-off-by: Kipchirchir Sigei <arapgodsmack@gmail.com>
  • Loading branch information
KipSigei committed Oct 22, 2019
1 parent 89e4a6b commit df1182a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 19 deletions.
26 changes: 10 additions & 16 deletions src/store/initStore.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,22 @@
import { applyMiddleware, createStore, combineReducers } from 'redux';
import thunk from 'redux-thunk';
import * as actions from './actions/actions';
import app from './reducers/app';
import filter from './reducers/filter';
import layersReducer from './reducers/layers';
import loc from './reducers/loc';
import locationsReducer from './reducers/locations';
import regions from './reducers/regions';
import styles from './reducers/styles';
import supersetConfig from './reducers/superset-config';
import { APP, FILTER, SUPERSET_CONFIGS, STYLES, REGIONS, LOCATIONS, LOC, LAYERS, MAP } from './reducers';

import { loadJSON } from '../utils/files';
import prepareLayer from '../map/prepareLayer';
import reducerRegistry from './reducerRegistry';

const defaultReducers = {
supersetConfig,
styles,
regions,
locationsReducer,
loc,
layersReducer,
filter,
...app,
SUPERSET_CONFIGS,
STYLES,
REGIONS,
LOCATIONS,
LOC,
LAYERS,
FILTER,
APP,
'map-1': MAP,
};
export function loadLayers(mapId, dispatch, layers) {
// Check if config has list of layers and add them to store
Expand Down
6 changes: 3 additions & 3 deletions src/store/reducers/createMapReducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,6 @@ export function createMapReducer(mapId) {
};
}

export default {
'map-1': createMapReducer('map-1'),
};
const MAP = createMapReducer('map-1');

export default MAP;
1 change: 1 addition & 0 deletions src/store/reducers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ export { default as LOCATIONS } from './locations';
export { default as REGIONS } from './regions';
export { default as STYLES } from './styles';
export { default as SUPERSET_CONFIGS } from './superset-config';
export { default as MAP } from './createMapReducer';

0 comments on commit df1182a

Please sign in to comment.