Skip to content

Commit

Permalink
Fix geosolutions-it#1610. Now the epics are overridable
Browse files Browse the repository at this point in the history
  • Loading branch information
offtherailz committed Mar 20, 2017
1 parent 14d6636 commit dce3a41
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion web/client/plugins/Search.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ module.exports = {
priority: 1
}
}),
epics: [searchEpic, searchItemSelected],
epics: {searchEpic, searchItemSelected},
reducers: {
search: require('../reducers/search'),
mapInfo: require('../reducers/mapInfo')
Expand Down
4 changes: 2 additions & 2 deletions web/client/utils/PluginsUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,15 @@ const getPluginItems = (state, plugins, pluginsConfig, name, id, isDefault, load
const getReducers = (plugins) => Object.keys(plugins).map((name) => plugins[name].reducers)
.reduce((previous, current) => assign({}, previous, current), {});
const getEpics = (plugins) => Object.keys(plugins).map((name) => plugins[name].epics)
.reduce((previous = [], current = []) => [ ...previous, ...current], []);
.reduce((previous = [], current = []) => assign({}, previous, current), {});
const PluginsUtils = {
combineReducers: (plugins, reducers) => {
const pluginsReducers = getReducers(plugins);
return combineReducers(assign({}, reducers, pluginsReducers));
},
combineEpics: (plugins, epics = []) => {
const pluginEpics = getEpics(plugins);
return combineEpics(...[ ...pluginEpics, ...epics]);
return combineEpics(...[ ...Object.keys(pluginEpics).map(k => pluginEpics[k]), ...epics]);
},
getReducers,
filterState,
Expand Down

0 comments on commit dce3a41

Please sign in to comment.