redux-dryer
Advanced tools
Comparing version 0.2.0 to 0.2.1
@@ -15,8 +15,16 @@ 'use strict'; | ||
var _merge = require('lodash/merge'); | ||
var _mergeWith = require('lodash/mergeWith'); | ||
var _merge2 = _interopRequireDefault(_merge); | ||
var _mergeWith2 = _interopRequireDefault(_mergeWith); | ||
var _isArray = require('lodash/isArray'); | ||
var _isArray2 = _interopRequireDefault(_isArray); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function overwriteArray(obj, src) { | ||
if (_isArray2.default) return src; | ||
} | ||
var generateReducer = function generateReducer(initialState, generatedActions) { | ||
@@ -31,5 +39,5 @@ // save actionsTypes in an array to avoid re-iteration | ||
var action = arguments[1]; | ||
return (0, _includes2.default)(actionsTypes, action.type) ? (0, _merge2.default)({}, state, | ||
return (0, _includes2.default)(actionsTypes, action.type) ? (0, _mergeWith2.default)({}, state, | ||
// if the payload is a function we'll inject state into it | ||
typeof action.payload === 'function' ? action.payload(state) : action.payload) : state; | ||
typeof action.payload === 'function' ? action.payload(state) : action.payload, overwriteArray) : state; | ||
}; | ||
@@ -36,0 +44,0 @@ }; |
{ | ||
"name": "redux-dryer", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "Redux utilities to keep your reducers small and DRY", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
89783
2610