feat(mapUi): Create mapUi specific service
This commit is contained in:
committed by
Stuart Taylor
parent
e0d084465e
commit
1d420b835c
@@ -1,25 +1,26 @@
|
||||
import {
|
||||
createAction,
|
||||
createAsyncTypes,
|
||||
createTypes,
|
||||
handleActions
|
||||
} from 'berkeleys-redux-utils';
|
||||
import { createSelector } from 'reselect';
|
||||
import noop from 'lodash/noop';
|
||||
import capitalize from 'lodash/capitalize';
|
||||
import { capitalize, noop} from 'lodash';
|
||||
|
||||
import * as utils from './utils.js';
|
||||
import ns from '../ns.json';
|
||||
import {
|
||||
types as app,
|
||||
createEventMetaCreator
|
||||
} from '../../redux';
|
||||
|
||||
export const epics = [];
|
||||
import fewtchMapUiEpic from './fetch-map-ui-epic';
|
||||
|
||||
export const epics = [ fewtchMapUiEpic ];
|
||||
|
||||
export const types = createTypes([
|
||||
'onRouteMap',
|
||||
'initMap',
|
||||
|
||||
createAsyncTypes('fetchMapUi'),
|
||||
'toggleThisPanel',
|
||||
|
||||
'isAllCollapsed',
|
||||
@@ -31,6 +32,12 @@ export const types = createTypes([
|
||||
|
||||
export const initMap = createAction(types.initMap);
|
||||
|
||||
export const fetchMapUiComplete = createAction(
|
||||
types.fetchMapUi.complete,
|
||||
(entities, result) => ({ entities, result }),
|
||||
entities => ({ entities })
|
||||
);
|
||||
|
||||
export const toggleThisPanel = createAction(types.toggleThisPanel);
|
||||
export const collapseAll = createAction(types.collapseAll);
|
||||
|
||||
@@ -100,7 +107,7 @@ export default handleActions(
|
||||
mapUi
|
||||
};
|
||||
},
|
||||
[app.fetchChallenges.complete]: (state, { payload }) => {
|
||||
[types.fetchMapUi.complete]: (state, { payload }) => {
|
||||
const { entities, result } = payload;
|
||||
return {
|
||||
...state,
|
||||
|
Reference in New Issue
Block a user