Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

React Native Android Friendly #5

Merged
merged 1 commit into from
Mar 22, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 4 additions & 24 deletions lib/ReduxInjector.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,31 +31,11 @@ function combineReducersRecurse(reducers) {
// If this is an object of functions, combine reducers.
if ((typeof reducers === 'undefined' ? 'undefined' : _typeof(reducers)) === 'object') {
var combinedReducers = {};
var _iteratorNormalCompletion = true;
var _didIteratorError = false;
var _iteratorError = undefined;

try {
for (var _iterator = Object.keys(reducers)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
var key = _step.value;

combinedReducers[key] = combineReducersRecurse(reducers[key]);
}
} catch (err) {
_didIteratorError = true;
_iteratorError = err;
} finally {
try {
if (!_iteratorNormalCompletion && _iterator.return) {
_iterator.return();
}
} finally {
if (_didIteratorError) {
throw _iteratorError;
}
}
var keys = Object.keys(reducers);
for (var i = 0; i < keys.length; i++) {
var key = keys[i];
combinedReducers[key] = combineReducersRecurse(reducers[key]);
}

return combine(combinedReducers);
}

Expand Down
22 changes: 11 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions src/ReduxInjector.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ export function combineReducersRecurse(reducers) {
// If this is an object of functions, combine reducers.
if (typeof reducers === 'object') {
let combinedReducers = {};
for (let key of Object.keys(reducers)) {
combinedReducers[key] = combineReducersRecurse(reducers[key]);
const keys = Object.keys(reducers)
for (let i = 0; i < keys.length; i++) {
const key = keys[i]
combinedReducers[key] = combineReducersRecurse(reducers[key])
}
return combine(combinedReducers);
}
Expand Down