Skip to content

Commit

Permalink
fix(reducers): non-debug mode for react-native on android - @compojoom
Browse files Browse the repository at this point in the history
fix(reducers): non-debug mode for react-native on android
  • Loading branch information
prescottprue authored Dec 21, 2018
2 parents ae82973 + e58a381 commit 80d491f
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/reducers/crossSliceReducer.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable guard-for-in, no-restricted-syntax, no-param-reassign */

import produce from 'immer';
import { values, groupBy, merge, set, get } from 'lodash';
import { values, groupBy, merge, set, get, keys } from 'lodash';
import { actionTypes } from '../constants';

export default function crossSliceReducer(state = {}, action) {
Expand All @@ -18,13 +18,14 @@ export default function crossSliceReducer(state = {}, action) {
c => c.storeAs || c.collection,
);

for (const storeAs in groups) {
keys(groups).forEach(storeAs => {
const updated = {};
for (const item of groups[storeAs]) {
merge(updated, get(item, 'data', {}));
}
groups[storeAs].forEach(item =>
merge(updated, get(item, 'data', {})),
);

set(draft, ['composite', storeAs], updated);
}
});

return draft;
default:
Expand Down

0 comments on commit 80d491f

Please sign in to comment.