multireducer
Advanced tools
Comparing version 3.0.3 to 3.1.0
@@ -62,16 +62,20 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
}); | ||
exports.wrapDispatch = exports.bindActionCreators = undefined; | ||
exports.wrapAction = exports.wrapDispatch = exports.bindActionCreators = undefined; | ||
var _plainMultireducer = __webpack_require__(10); | ||
var _plainMultireducer = __webpack_require__(12); | ||
var _plainMultireducer2 = _interopRequireDefault(_plainMultireducer); | ||
var _bindActionCreators = __webpack_require__(7); | ||
var _bindActionCreators = __webpack_require__(9); | ||
var _bindActionCreators2 = _interopRequireDefault(_bindActionCreators); | ||
var _wrapDispatch = __webpack_require__(2); | ||
var _wrapDispatch = __webpack_require__(3); | ||
var _wrapDispatch2 = _interopRequireDefault(_wrapDispatch); | ||
var _wrapAction = __webpack_require__(2); | ||
var _wrapAction2 = _interopRequireDefault(_wrapAction); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -81,2 +85,3 @@ | ||
exports.wrapDispatch = _wrapDispatch2.default; | ||
exports.wrapAction = _wrapAction2.default; | ||
exports.default = _plainMultireducer2.default; | ||
@@ -107,7 +112,35 @@ | ||
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; | ||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
exports.default = wrapAction; | ||
var _key = __webpack_require__(1); | ||
var _key2 = _interopRequireDefault(_key); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
function wrapAction(action, reducerKey) { | ||
return _extends({}, action, { | ||
meta: _extends({}, action.meta, _defineProperty({}, _key2.default, reducerKey)) | ||
}); | ||
} | ||
/***/ }, | ||
/* 3 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
exports.default = wrapDispatch; | ||
var _wrapAction = __webpack_require__(11); | ||
var _wrapAction = __webpack_require__(2); | ||
@@ -135,9 +168,21 @@ var _wrapAction2 = _interopRequireDefault(_wrapAction); | ||
/***/ }, | ||
/* 3 */ | ||
/* 4 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
var getPrototype = __webpack_require__(12), | ||
isHostObject = __webpack_require__(13), | ||
isObjectLike = __webpack_require__(14); | ||
var root = __webpack_require__(19); | ||
/** Built-in value references. */ | ||
var Symbol = root.Symbol; | ||
module.exports = Symbol; | ||
/***/ }, | ||
/* 5 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
var baseGetTag = __webpack_require__(13), | ||
getPrototype = __webpack_require__(15), | ||
isObjectLike = __webpack_require__(20); | ||
/** `Object#toString` result references. */ | ||
@@ -147,6 +192,7 @@ var objectTag = '[object Object]'; | ||
/** Used for built-in method references. */ | ||
var objectProto = Object.prototype; | ||
var funcProto = Function.prototype, | ||
objectProto = Object.prototype; | ||
/** Used to resolve the decompiled source of functions. */ | ||
var funcToString = Function.prototype.toString; | ||
var funcToString = funcProto.toString; | ||
@@ -160,9 +206,2 @@ /** Used to check objects for own properties. */ | ||
/** | ||
* Used to resolve the | ||
* [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) | ||
* of values. | ||
*/ | ||
var objectToString = objectProto.toString; | ||
/** | ||
* Checks if `value` is a plain object, that is, an object created by the | ||
@@ -176,4 +215,3 @@ * `Object` constructor or one with a `[[Prototype]]` of `null`. | ||
* @param {*} value The value to check. | ||
* @returns {boolean} Returns `true` if `value` is a plain object, | ||
* else `false`. | ||
* @returns {boolean} Returns `true` if `value` is a plain object, else `false`. | ||
* @example | ||
@@ -198,4 +236,3 @@ * | ||
function isPlainObject(value) { | ||
if (!isObjectLike(value) || | ||
objectToString.call(value) != objectTag || isHostObject(value)) { | ||
if (!isObjectLike(value) || baseGetTag(value) != objectTag) { | ||
return false; | ||
@@ -208,4 +245,4 @@ } | ||
var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; | ||
return (typeof Ctor == 'function' && | ||
Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString); | ||
return typeof Ctor == 'function' && Ctor instanceof Ctor && | ||
funcToString.call(Ctor) == objectCtorString; | ||
} | ||
@@ -217,3 +254,3 @@ | ||
/***/ }, | ||
/* 4 */ | ||
/* 6 */ | ||
/***/ function(module, exports) { | ||
@@ -245,21 +282,19 @@ | ||
}; | ||
} else { | ||
var _ret = function () { | ||
var last = funcs[funcs.length - 1]; | ||
var rest = funcs.slice(0, -1); | ||
return { | ||
v: function v() { | ||
return rest.reduceRight(function (composed, f) { | ||
return f(composed); | ||
}, last.apply(undefined, arguments)); | ||
} | ||
}; | ||
}(); | ||
} | ||
if (typeof _ret === "object") return _ret.v; | ||
if (funcs.length === 1) { | ||
return funcs[0]; | ||
} | ||
var last = funcs[funcs.length - 1]; | ||
var rest = funcs.slice(0, -1); | ||
return function () { | ||
return rest.reduceRight(function (composed, f) { | ||
return f(composed); | ||
}, last.apply(undefined, arguments)); | ||
}; | ||
} | ||
/***/ }, | ||
/* 5 */ | ||
/* 7 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
@@ -271,13 +306,13 @@ | ||
exports.ActionTypes = undefined; | ||
exports["default"] = createStore; | ||
exports['default'] = createStore; | ||
var _isPlainObject = __webpack_require__(3); | ||
var _isPlainObject = __webpack_require__(5); | ||
var _isPlainObject2 = _interopRequireDefault(_isPlainObject); | ||
var _symbolObservable = __webpack_require__(19); | ||
var _symbolObservable = __webpack_require__(25); | ||
var _symbolObservable2 = _interopRequireDefault(_symbolObservable); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
@@ -305,3 +340,3 @@ /** | ||
* | ||
* @param {any} [initialState] The initial state. You may optionally specify it | ||
* @param {any} [preloadedState] The initial state. You may optionally specify it | ||
* to hydrate the state from the server in universal apps, or to restore a | ||
@@ -320,8 +355,8 @@ * previously serialized user session. | ||
*/ | ||
function createStore(reducer, initialState, enhancer) { | ||
function createStore(reducer, preloadedState, enhancer) { | ||
var _ref2; | ||
if (typeof initialState === 'function' && typeof enhancer === 'undefined') { | ||
enhancer = initialState; | ||
initialState = undefined; | ||
if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') { | ||
enhancer = preloadedState; | ||
preloadedState = undefined; | ||
} | ||
@@ -334,3 +369,3 @@ | ||
return enhancer(createStore)(reducer, initialState); | ||
return enhancer(createStore)(reducer, preloadedState); | ||
} | ||
@@ -343,3 +378,3 @@ | ||
var currentReducer = reducer; | ||
var currentState = initialState; | ||
var currentState = preloadedState; | ||
var currentListeners = []; | ||
@@ -436,3 +471,3 @@ var nextListeners = currentListeners; | ||
function dispatch(action) { | ||
if (!(0, _isPlainObject2["default"])(action)) { | ||
if (!(0, _isPlainObject2['default'])(action)) { | ||
throw new Error('Actions must be plain objects. ' + 'Use custom middleware for async actions.'); | ||
@@ -502,3 +537,2 @@ } | ||
*/ | ||
subscribe: function subscribe(observer) { | ||
@@ -519,3 +553,3 @@ if (typeof observer !== 'object') { | ||
} | ||
}, _ref[_symbolObservable2["default"]] = function () { | ||
}, _ref[_symbolObservable2['default']] = function () { | ||
return this; | ||
@@ -535,7 +569,7 @@ }, _ref; | ||
replaceReducer: replaceReducer | ||
}, _ref2[_symbolObservable2["default"]] = observable, _ref2; | ||
}, _ref2[_symbolObservable2['default']] = observable, _ref2; | ||
} | ||
/***/ }, | ||
/* 6 */ | ||
/* 8 */ | ||
/***/ function(module, exports) { | ||
@@ -546,3 +580,3 @@ | ||
exports.__esModule = true; | ||
exports["default"] = warning; | ||
exports['default'] = warning; | ||
/** | ||
@@ -571,3 +605,3 @@ * Prints a warning in the console if it exists. | ||
/***/ }, | ||
/* 7 */ | ||
/* 9 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
@@ -582,5 +616,5 @@ | ||
var _redux = __webpack_require__(18); | ||
var _redux = __webpack_require__(24); | ||
var _wrapDispatch = __webpack_require__(2); | ||
var _wrapDispatch = __webpack_require__(3); | ||
@@ -597,3 +631,3 @@ var _wrapDispatch2 = _interopRequireDefault(_wrapDispatch); | ||
/***/ }, | ||
/* 8 */ | ||
/* 10 */ | ||
/***/ function(module, exports) { | ||
@@ -611,3 +645,3 @@ | ||
/***/ }, | ||
/* 9 */ | ||
/* 11 */ | ||
/***/ function(module, exports) { | ||
@@ -638,3 +672,3 @@ | ||
/***/ }, | ||
/* 10 */ | ||
/* 12 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
@@ -652,3 +686,3 @@ | ||
var _mapValues = __webpack_require__(9); | ||
var _mapValues = __webpack_require__(11); | ||
@@ -661,3 +695,3 @@ var _mapValues2 = _interopRequireDefault(_mapValues); | ||
var _initAction = __webpack_require__(8); | ||
var _initAction = __webpack_require__(10); | ||
@@ -685,3 +719,3 @@ var _initAction2 = _interopRequireDefault(_initAction); | ||
return function () { | ||
var state = arguments.length <= 0 || arguments[0] === undefined ? initialState : arguments[0]; | ||
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState; | ||
var action = arguments[1]; | ||
@@ -710,78 +744,176 @@ | ||
/***/ }, | ||
/* 11 */ | ||
/* 13 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
var Symbol = __webpack_require__(4), | ||
getRawTag = __webpack_require__(16), | ||
objectToString = __webpack_require__(17); | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
/** `Object#toString` result references. */ | ||
var nullTag = '[object Null]', | ||
undefinedTag = '[object Undefined]'; | ||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
/** Built-in value references. */ | ||
var symToStringTag = Symbol ? Symbol.toStringTag : undefined; | ||
exports.default = wrapAction; | ||
/** | ||
* The base implementation of `getTag` without fallbacks for buggy environments. | ||
* | ||
* @private | ||
* @param {*} value The value to query. | ||
* @returns {string} Returns the `toStringTag`. | ||
*/ | ||
function baseGetTag(value) { | ||
if (value == null) { | ||
return value === undefined ? undefinedTag : nullTag; | ||
} | ||
return (symToStringTag && symToStringTag in Object(value)) | ||
? getRawTag(value) | ||
: objectToString(value); | ||
} | ||
var _key = __webpack_require__(1); | ||
module.exports = baseGetTag; | ||
var _key2 = _interopRequireDefault(_key); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
/***/ }, | ||
/* 14 */ | ||
/***/ function(module, exports) { | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
/* WEBPACK VAR INJECTION */(function(global) {/** Detect free variable `global` from Node.js. */ | ||
var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; | ||
function wrapAction(action, reducerKey) { | ||
return _extends({}, action, { | ||
meta: _extends({}, action.meta, _defineProperty({}, _key2.default, reducerKey)) | ||
}); | ||
module.exports = freeGlobal; | ||
/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) | ||
/***/ }, | ||
/* 15 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
var overArg = __webpack_require__(18); | ||
/** Built-in value references. */ | ||
var getPrototype = overArg(Object.getPrototypeOf, Object); | ||
module.exports = getPrototype; | ||
/***/ }, | ||
/* 16 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
var Symbol = __webpack_require__(4); | ||
/** Used for built-in method references. */ | ||
var objectProto = Object.prototype; | ||
/** Used to check objects for own properties. */ | ||
var hasOwnProperty = objectProto.hasOwnProperty; | ||
/** | ||
* Used to resolve the | ||
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) | ||
* of values. | ||
*/ | ||
var nativeObjectToString = objectProto.toString; | ||
/** Built-in value references. */ | ||
var symToStringTag = Symbol ? Symbol.toStringTag : undefined; | ||
/** | ||
* A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. | ||
* | ||
* @private | ||
* @param {*} value The value to query. | ||
* @returns {string} Returns the raw `toStringTag`. | ||
*/ | ||
function getRawTag(value) { | ||
var isOwn = hasOwnProperty.call(value, symToStringTag), | ||
tag = value[symToStringTag]; | ||
try { | ||
value[symToStringTag] = undefined; | ||
var unmasked = true; | ||
} catch (e) {} | ||
var result = nativeObjectToString.call(value); | ||
if (unmasked) { | ||
if (isOwn) { | ||
value[symToStringTag] = tag; | ||
} else { | ||
delete value[symToStringTag]; | ||
} | ||
} | ||
return result; | ||
} | ||
module.exports = getRawTag; | ||
/***/ }, | ||
/* 12 */ | ||
/* 17 */ | ||
/***/ function(module, exports) { | ||
/* Built-in method references for those with the same name as other `lodash` methods. */ | ||
var nativeGetPrototype = Object.getPrototypeOf; | ||
/** Used for built-in method references. */ | ||
var objectProto = Object.prototype; | ||
/** | ||
* Gets the `[[Prototype]]` of `value`. | ||
* Used to resolve the | ||
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) | ||
* of values. | ||
*/ | ||
var nativeObjectToString = objectProto.toString; | ||
/** | ||
* Converts `value` to a string using `Object.prototype.toString`. | ||
* | ||
* @private | ||
* @param {*} value The value to query. | ||
* @returns {null|Object} Returns the `[[Prototype]]`. | ||
* @param {*} value The value to convert. | ||
* @returns {string} Returns the converted string. | ||
*/ | ||
function getPrototype(value) { | ||
return nativeGetPrototype(Object(value)); | ||
function objectToString(value) { | ||
return nativeObjectToString.call(value); | ||
} | ||
module.exports = getPrototype; | ||
module.exports = objectToString; | ||
/***/ }, | ||
/* 13 */ | ||
/* 18 */ | ||
/***/ function(module, exports) { | ||
/** | ||
* Checks if `value` is a host object in IE < 9. | ||
* Creates a unary function that invokes `func` with its argument transformed. | ||
* | ||
* @private | ||
* @param {*} value The value to check. | ||
* @returns {boolean} Returns `true` if `value` is a host object, else `false`. | ||
* @param {Function} func The function to wrap. | ||
* @param {Function} transform The argument transform. | ||
* @returns {Function} Returns the new function. | ||
*/ | ||
function isHostObject(value) { | ||
// Many host objects are `Object` objects that can coerce to strings | ||
// despite having improperly defined `toString` methods. | ||
var result = false; | ||
if (value != null && typeof value.toString != 'function') { | ||
try { | ||
result = !!(value + ''); | ||
} catch (e) {} | ||
} | ||
return result; | ||
function overArg(func, transform) { | ||
return function(arg) { | ||
return func(transform(arg)); | ||
}; | ||
} | ||
module.exports = isHostObject; | ||
module.exports = overArg; | ||
/***/ }, | ||
/* 14 */ | ||
/* 19 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
var freeGlobal = __webpack_require__(14); | ||
/** Detect free variable `self`. */ | ||
var freeSelf = typeof self == 'object' && self && self.Object === Object && self; | ||
/** Used as a reference to the global object. */ | ||
var root = freeGlobal || freeSelf || Function('return this')(); | ||
module.exports = root; | ||
/***/ }, | ||
/* 20 */ | ||
/***/ function(module, exports) { | ||
@@ -814,3 +946,3 @@ | ||
function isObjectLike(value) { | ||
return !!value && typeof value == 'object'; | ||
return value != null && typeof value == 'object'; | ||
} | ||
@@ -822,3 +954,3 @@ | ||
/***/ }, | ||
/* 15 */ | ||
/* 21 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
@@ -832,9 +964,9 @@ | ||
exports["default"] = applyMiddleware; | ||
exports['default'] = applyMiddleware; | ||
var _compose = __webpack_require__(4); | ||
var _compose = __webpack_require__(6); | ||
var _compose2 = _interopRequireDefault(_compose); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
@@ -863,4 +995,4 @@ /** | ||
return function (createStore) { | ||
return function (reducer, initialState, enhancer) { | ||
var store = createStore(reducer, initialState, enhancer); | ||
return function (reducer, preloadedState, enhancer) { | ||
var store = createStore(reducer, preloadedState, enhancer); | ||
var _dispatch = store.dispatch; | ||
@@ -878,3 +1010,3 @@ var chain = []; | ||
}); | ||
_dispatch = _compose2["default"].apply(undefined, chain)(store.dispatch); | ||
_dispatch = _compose2['default'].apply(undefined, chain)(store.dispatch); | ||
@@ -889,3 +1021,3 @@ return _extends({}, store, { | ||
/***/ }, | ||
/* 16 */ | ||
/* 22 */ | ||
/***/ function(module, exports) { | ||
@@ -896,3 +1028,3 @@ | ||
exports.__esModule = true; | ||
exports["default"] = bindActionCreators; | ||
exports['default'] = bindActionCreators; | ||
function bindActionCreator(actionCreator, dispatch) { | ||
@@ -947,3 +1079,3 @@ return function () { | ||
/***/ }, | ||
/* 17 */ | ||
/* 23 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
@@ -954,15 +1086,15 @@ | ||
exports.__esModule = true; | ||
exports["default"] = combineReducers; | ||
exports['default'] = combineReducers; | ||
var _createStore = __webpack_require__(5); | ||
var _createStore = __webpack_require__(7); | ||
var _isPlainObject = __webpack_require__(3); | ||
var _isPlainObject = __webpack_require__(5); | ||
var _isPlainObject2 = _interopRequireDefault(_isPlainObject); | ||
var _warning = __webpack_require__(6); | ||
var _warning = __webpack_require__(8); | ||
var _warning2 = _interopRequireDefault(_warning); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
@@ -976,5 +1108,5 @@ function getUndefinedStateErrorMessage(key, action) { | ||
function getUnexpectedStateShapeWarningMessage(inputState, reducers, action) { | ||
function getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) { | ||
var reducerKeys = Object.keys(reducers); | ||
var argumentName = action && action.type === _createStore.ActionTypes.INIT ? 'initialState argument passed to createStore' : 'previous state received by the reducer'; | ||
var argumentName = action && action.type === _createStore.ActionTypes.INIT ? 'preloadedState argument passed to createStore' : 'previous state received by the reducer'; | ||
@@ -985,3 +1117,3 @@ if (reducerKeys.length === 0) { | ||
if (!(0, _isPlainObject2["default"])(inputState)) { | ||
if (!(0, _isPlainObject2['default'])(inputState)) { | ||
return 'The ' + argumentName + ' has unexpected type of "' + {}.toString.call(inputState).match(/\s([a-z|A-Z]+)/)[1] + '". Expected argument to be an object with the following ' + ('keys: "' + reducerKeys.join('", "') + '"'); | ||
@@ -991,5 +1123,9 @@ } | ||
var unexpectedKeys = Object.keys(inputState).filter(function (key) { | ||
return !reducers.hasOwnProperty(key); | ||
return !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key]; | ||
}); | ||
unexpectedKeys.forEach(function (key) { | ||
unexpectedKeyCache[key] = true; | ||
}); | ||
if (unexpectedKeys.length > 0) { | ||
@@ -1037,2 +1173,9 @@ return 'Unexpected ' + (unexpectedKeys.length > 1 ? 'keys' : 'key') + ' ' + ('"' + unexpectedKeys.join('", "') + '" found in ' + argumentName + '. ') + 'Expected to find one of the known reducer keys instead: ' + ('"' + reducerKeys.join('", "') + '". Unexpected keys will be ignored.'); | ||
var key = reducerKeys[i]; | ||
if (true) { | ||
if (typeof reducers[key] === 'undefined') { | ||
(0, _warning2['default'])('No reducer provided for key "' + key + '"'); | ||
} | ||
} | ||
if (typeof reducers[key] === 'function') { | ||
@@ -1044,2 +1187,6 @@ finalReducers[key] = reducers[key]; | ||
if (true) { | ||
var unexpectedKeyCache = {}; | ||
} | ||
var sanityError; | ||
@@ -1061,5 +1208,5 @@ try { | ||
if (true) { | ||
var warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action); | ||
var warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache); | ||
if (warningMessage) { | ||
(0, _warning2["default"])(warningMessage); | ||
(0, _warning2['default'])(warningMessage); | ||
} | ||
@@ -1087,3 +1234,3 @@ } | ||
/***/ }, | ||
/* 18 */ | ||
/* 24 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
@@ -1096,27 +1243,27 @@ | ||
var _createStore = __webpack_require__(5); | ||
var _createStore = __webpack_require__(7); | ||
var _createStore2 = _interopRequireDefault(_createStore); | ||
var _combineReducers = __webpack_require__(17); | ||
var _combineReducers = __webpack_require__(23); | ||
var _combineReducers2 = _interopRequireDefault(_combineReducers); | ||
var _bindActionCreators = __webpack_require__(16); | ||
var _bindActionCreators = __webpack_require__(22); | ||
var _bindActionCreators2 = _interopRequireDefault(_bindActionCreators); | ||
var _applyMiddleware = __webpack_require__(15); | ||
var _applyMiddleware = __webpack_require__(21); | ||
var _applyMiddleware2 = _interopRequireDefault(_applyMiddleware); | ||
var _compose = __webpack_require__(4); | ||
var _compose = __webpack_require__(6); | ||
var _compose2 = _interopRequireDefault(_compose); | ||
var _warning = __webpack_require__(6); | ||
var _warning = __webpack_require__(8); | ||
var _warning2 = _interopRequireDefault(_warning); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
@@ -1130,24 +1277,55 @@ /* | ||
if (("development") !== 'production' && typeof isCrushed.name === 'string' && isCrushed.name !== 'isCrushed') { | ||
(0, _warning2["default"])('You are currently using minified code outside of NODE_ENV === \'production\'. ' + 'This means that you are running a slower development build of Redux. ' + 'You can use loose-envify (https://github.com/zertosh/loose-envify) for browserify ' + 'or DefinePlugin for webpack (http://stackoverflow.com/questions/30030031) ' + 'to ensure you have the correct code for your production build.'); | ||
(0, _warning2['default'])('You are currently using minified code outside of NODE_ENV === \'production\'. ' + 'This means that you are running a slower development build of Redux. ' + 'You can use loose-envify (https://github.com/zertosh/loose-envify) for browserify ' + 'or DefinePlugin for webpack (http://stackoverflow.com/questions/30030031) ' + 'to ensure you have the correct code for your production build.'); | ||
} | ||
exports.createStore = _createStore2["default"]; | ||
exports.combineReducers = _combineReducers2["default"]; | ||
exports.bindActionCreators = _bindActionCreators2["default"]; | ||
exports.applyMiddleware = _applyMiddleware2["default"]; | ||
exports.compose = _compose2["default"]; | ||
exports.createStore = _createStore2['default']; | ||
exports.combineReducers = _combineReducers2['default']; | ||
exports.bindActionCreators = _bindActionCreators2['default']; | ||
exports.applyMiddleware = _applyMiddleware2['default']; | ||
exports.compose = _compose2['default']; | ||
/***/ }, | ||
/* 19 */ | ||
/* 25 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
/* WEBPACK VAR INJECTION */(function(global) {/* global window */ | ||
'use strict'; | ||
module.exports = __webpack_require__(26); | ||
module.exports = __webpack_require__(20)(global || window || this); | ||
/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) | ||
/***/ }, | ||
/* 26 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
/* WEBPACK VAR INJECTION */(function(global, module) {'use strict'; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var _ponyfill = __webpack_require__(27); | ||
var _ponyfill2 = _interopRequireDefault(_ponyfill); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
var root; /* global window */ | ||
if (typeof self !== 'undefined') { | ||
root = self; | ||
} else if (typeof window !== 'undefined') { | ||
root = window; | ||
} else if (typeof global !== 'undefined') { | ||
root = global; | ||
} else if (true) { | ||
root = module; | ||
} else { | ||
root = Function('return this')(); | ||
} | ||
var result = (0, _ponyfill2['default'])(root); | ||
exports['default'] = result; | ||
/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()), __webpack_require__(28)(module))) | ||
/***/ }, | ||
/* 20 */ | ||
/* 27 */ | ||
/***/ function(module, exports) { | ||
@@ -1157,12 +1335,16 @@ | ||
module.exports = function symbolObservablePonyfill(root) { | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports['default'] = symbolObservablePonyfill; | ||
function symbolObservablePonyfill(root) { | ||
var result; | ||
var Symbol = root.Symbol; | ||
var _Symbol = root.Symbol; | ||
if (typeof Symbol === 'function') { | ||
if (Symbol.observable) { | ||
result = Symbol.observable; | ||
if (typeof _Symbol === 'function') { | ||
if (_Symbol.observable) { | ||
result = _Symbol.observable; | ||
} else { | ||
result = Symbol('observable'); | ||
Symbol.observable = result; | ||
result = _Symbol('observable'); | ||
_Symbol.observable = result; | ||
} | ||
@@ -1176,3 +1358,18 @@ } else { | ||
/***/ }, | ||
/* 28 */ | ||
/***/ function(module, exports) { | ||
module.exports = function(module) { | ||
if(!module.webpackPolyfill) { | ||
module.deprecate = function() {}; | ||
module.paths = []; | ||
// module.parent = undefined by default | ||
module.children = []; | ||
module.webpackPolyfill = 1; | ||
} | ||
return module; | ||
} | ||
/***/ } | ||
@@ -1179,0 +1376,0 @@ /******/ ]) |
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Multireducer=t():e.Multireducer=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0}),t.wrapDispatch=t.bindActionCreators=void 0;var o=n(10),u=r(o),i=n(7),c=r(i),f=n(2),a=r(f);t.bindActionCreators=c.default,t.wrapDispatch=a.default,t.default=u.default},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n="__multireducerKey";t.default=n},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){var n=function r(n){var o=void 0;return"function"==typeof n?o=function(e,o,u){return n(r,o,e,t,u)}:"object"===("undefined"==typeof n?"undefined":u(n))&&(o=(0,c.default)(n,t)),e(o)};return n}Object.defineProperty(t,"__esModule",{value:!0});var u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};t.default=o;var i=n(11),c=r(i)},function(e,t,n){function r(e){if(!i(e)||l.call(e)!=c||u(e))return!1;var t=o(e);if(null===t)return!0;var n=d.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&a.call(n)==s}var o=n(12),u=n(13),i=n(14),c="[object Object]",f=Object.prototype,a=Function.prototype.toString,d=f.hasOwnProperty,s=a.call(Object),l=f.toString;e.exports=r},function(e,t){"use strict";function n(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];if(0===t.length)return function(e){return e};var r=function(){var e=t[t.length-1],n=t.slice(0,-1);return{v:function(){return n.reduceRight(function(e,t){return t(e)},e.apply(void 0,arguments))}}}();return"object"==typeof r?r.v:void 0}t.__esModule=!0,t.default=n},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t,n){function r(){h===b&&(h=b.slice())}function u(){return v}function c(e){if("function"!=typeof e)throw new Error("Expected listener to be a function.");var t=!0;return r(),h.push(e),function(){if(t){t=!1,r();var n=h.indexOf(e);h.splice(n,1)}}}function d(e){if(!(0,i.default)(e))throw new Error("Actions must be plain objects. Use custom middleware for async actions.");if("undefined"==typeof e.type)throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(_)throw new Error("Reducers may not dispatch actions.");try{_=!0,v=y(v,e)}finally{_=!1}for(var t=b=h,n=0;n<t.length;n++)t[n]();return e}function s(e){if("function"!=typeof e)throw new Error("Expected the nextReducer to be a function.");y=e,d({type:a.INIT})}function l(){var e,t=c;return e={subscribe:function(e){function n(){e.next&&e.next(u())}if("object"!=typeof e)throw new TypeError("Expected the observer to be an object.");n();var r=t(n);return{unsubscribe:r}}},e[f.default]=function(){return this},e}var p;if("function"==typeof t&&"undefined"==typeof n&&(n=t,t=void 0),"undefined"!=typeof n){if("function"!=typeof n)throw new Error("Expected the enhancer to be a function.");return n(o)(e,t)}if("function"!=typeof e)throw new Error("Expected the reducer to be a function.");var y=e,v=t,b=[],h=b,_=!1;return d({type:a.INIT}),p={dispatch:d,subscribe:c,getState:u,replaceReducer:s},p[f.default]=l,p}t.__esModule=!0,t.ActionTypes=void 0,t.default=o;var u=n(3),i=r(u),c=n(19),f=r(c),a=t.ActionTypes={INIT:"@@redux/INIT"}},function(e,t){"use strict";function n(e){"undefined"!=typeof console&&"function"==typeof console.error&&console.error(e);try{throw new Error(e)}catch(t){}}t.__esModule=!0,t.default=n},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t,n){var r=(0,c.default)(t,n);return(0,u.bindActionCreators)(e,r)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var u=n(18),i=n(2),c=r(i)},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={type:"@@multireducer/INIT"};t.default=n},function(e,t){"use strict";function n(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){return Object.keys(e).reduce(function(r,u){return o({},r,n({},u,t(e[u],u)))},{})}Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t.default=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u(e,t){var n=void 0;if("function"==typeof e){if(!t)throw new Error("No key specified for custom mounting of reducer");n=!0}var r=n?e(void 0,l.default):(0,f.default)(e,function(e){return e(void 0,l.default)});return function(){var u=arguments.length<=0||void 0===arguments[0]?r:arguments[0],c=arguments[1];if(c&&c.meta&&c.meta[d.default]){var f=c.meta[d.default];if(n&&t===f)return e(u,c);var a=e[f];if(a)return i({},u,o({},f,a(u[f],c)))}return u}}Object.defineProperty(t,"__esModule",{value:!0});var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t.default=u;var c=n(9),f=r(c),a=n(1),d=r(a),s=n(8),l=r(s)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u(e,t){return i({},e,{meta:i({},e.meta,o({},f.default,t))})}Object.defineProperty(t,"__esModule",{value:!0});var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t.default=u;var c=n(1),f=r(c)},function(e,t){function n(e){return r(Object(e))}var r=Object.getPrototypeOf;e.exports=n},function(e,t){function n(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(n){}return t}e.exports=n},function(e,t){function n(e){return!!e&&"object"==typeof e}e.exports=n},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return function(n,r,o){var i=e(n,r,o),f=i.dispatch,a=[],d={getState:i.getState,dispatch:function(e){return f(e)}};return a=t.map(function(e){return e(d)}),f=c.default.apply(void 0,a)(i.dispatch),u({},i,{dispatch:f})}}}t.__esModule=!0;var u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t.default=o;var i=n(4),c=r(i)},function(e,t){"use strict";function n(e,t){return function(){return t(e.apply(void 0,arguments))}}function r(e,t){if("function"==typeof e)return n(e,t);if("object"!=typeof e||null===e)throw new Error("bindActionCreators expected an object or a function, instead received "+(null===e?"null":typeof e)+'. Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?');for(var r=Object.keys(e),o={},u=0;u<r.length;u++){var i=r[u],c=e[i];"function"==typeof c&&(o[i]=n(c,t))}return o}t.__esModule=!0,t.default=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){var n=t&&t.type,r=n&&'"'+n.toString()+'"'||"an action";return"Given action "+r+', reducer "'+e+'" returned undefined. To ignore an action, you must explicitly return the previous state.'}function u(e){Object.keys(e).forEach(function(t){var n=e[t],r=n(void 0,{type:c.ActionTypes.INIT});if("undefined"==typeof r)throw new Error('Reducer "'+t+'" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined.');var o="@@redux/PROBE_UNKNOWN_ACTION_"+Math.random().toString(36).substring(7).split("").join(".");if("undefined"==typeof n(void 0,{type:o}))throw new Error('Reducer "'+t+'" returned undefined when probed with a random type. '+("Don't try to handle "+c.ActionTypes.INIT+' or other actions in "redux/*" ')+"namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined.")})}function i(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++){var i=t[r];"function"==typeof e[i]&&(n[i]=e[i])}var c,f=Object.keys(n);try{u(n)}catch(a){c=a}return function(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],t=arguments[1];if(c)throw c;for(var r=!1,u={},i=0;i<f.length;i++){var a=f[i],d=n[a],s=e[a],l=d(s,t);if("undefined"==typeof l){var p=o(a,t);throw new Error(p)}u[a]=l,r=r||l!==s}return r?u:e}}t.__esModule=!0,t.default=i;var c=n(5),f=n(3),a=(r(f),n(6));r(a)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0,t.compose=t.applyMiddleware=t.bindActionCreators=t.combineReducers=t.createStore=void 0;var o=n(5),u=r(o),i=n(17),c=r(i),f=n(16),a=r(f),d=n(15),s=r(d),l=n(4),p=r(l),y=n(6);r(y);t.createStore=u.default,t.combineReducers=c.default,t.bindActionCreators=a.default,t.applyMiddleware=s.default,t.compose=p.default},function(e,t,n){(function(t){"use strict";e.exports=n(20)(t||window||this)}).call(t,function(){return this}())},function(e,t){"use strict";e.exports=function(e){var t,n=e.Symbol;return"function"==typeof n?n.observable?t=n.observable:(t=n("observable"),n.observable=t):t="@@observable",t}}])}); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Multireducer=t():e.Multireducer=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.wrapAction=t.wrapDispatch=t.bindActionCreators=void 0;var o=n(12),u=r(o),i=n(9),c=r(i),f=n(3),a=r(f),d=n(2),l=r(d);t.bindActionCreators=c.default,t.wrapDispatch=a.default,t.wrapAction=l.default,t.default=u.default},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n="__multireducerKey";t.default=n},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u(e,t){return i({},e,{meta:i({},e.meta,o({},f.default,t))})}Object.defineProperty(t,"__esModule",{value:!0});var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t.default=u;var c=n(1),f=r(c)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var n=function n(r){var o=void 0;return"function"==typeof r?o=function(e,o,u){return r(n,o,e,t,u)}:"object"===("undefined"==typeof r?"undefined":u(r))&&(o=(0,c.default)(r,t)),e(o)};return n}Object.defineProperty(t,"__esModule",{value:!0});var u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.default=o;var i=n(2),c=r(i)},function(e,t,n){var r=n(19),o=r.Symbol;e.exports=o},function(e,t,n){function r(e){if(!i(e)||o(e)!=c)return!1;var t=u(e);if(null===t)return!0;var n=l.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&d.call(n)==s}var o=n(13),u=n(15),i=n(20),c="[object Object]",f=Function.prototype,a=Object.prototype,d=f.toString,l=a.hasOwnProperty,s=d.call(Object);e.exports=r},function(e,t){"use strict";function n(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];if(0===t.length)return function(e){return e};if(1===t.length)return t[0];var r=t[t.length-1],o=t.slice(0,-1);return function(){return o.reduceRight(function(e,t){return t(e)},r.apply(void 0,arguments))}}t.__esModule=!0,t.default=n},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t,n){function r(){h===b&&(h=b.slice())}function u(){return v}function c(e){if("function"!=typeof e)throw new Error("Expected listener to be a function.");var t=!0;return r(),h.push(e),function(){if(t){t=!1,r();var n=h.indexOf(e);h.splice(n,1)}}}function d(e){if(!(0,i.default)(e))throw new Error("Actions must be plain objects. Use custom middleware for async actions.");if("undefined"==typeof e.type)throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(_)throw new Error("Reducers may not dispatch actions.");try{_=!0,v=y(v,e)}finally{_=!1}for(var t=b=h,n=0;n<t.length;n++)t[n]();return e}function l(e){if("function"!=typeof e)throw new Error("Expected the nextReducer to be a function.");y=e,d({type:a.INIT})}function s(){var e,t=c;return e={subscribe:function(e){function n(){e.next&&e.next(u())}if("object"!=typeof e)throw new TypeError("Expected the observer to be an object.");n();var r=t(n);return{unsubscribe:r}}},e[f.default]=function(){return this},e}var p;if("function"==typeof t&&"undefined"==typeof n&&(n=t,t=void 0),"undefined"!=typeof n){if("function"!=typeof n)throw new Error("Expected the enhancer to be a function.");return n(o)(e,t)}if("function"!=typeof e)throw new Error("Expected the reducer to be a function.");var y=e,v=t,b=[],h=b,_=!1;return d({type:a.INIT}),p={dispatch:d,subscribe:c,getState:u,replaceReducer:l},p[f.default]=s,p}t.__esModule=!0,t.ActionTypes=void 0,t.default=o;var u=n(5),i=r(u),c=n(25),f=r(c),a=t.ActionTypes={INIT:"@@redux/INIT"}},function(e,t){"use strict";function n(e){"undefined"!=typeof console&&"function"==typeof console.error&&console.error(e);try{throw new Error(e)}catch(e){}}t.__esModule=!0,t.default=n},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t,n){var r=(0,c.default)(t,n);return(0,u.bindActionCreators)(e,r)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var u=n(24),i=n(3),c=r(i)},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={type:"@@multireducer/INIT"};t.default=n},function(e,t){"use strict";function n(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){return Object.keys(e).reduce(function(r,u){return o({},r,n({},u,t(e[u],u)))},{})}Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t.default=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u(e,t){var n=void 0;if("function"==typeof e){if(!t)throw new Error("No key specified for custom mounting of reducer");n=!0}var r=n?e(void 0,s.default):(0,f.default)(e,function(e){return e(void 0,s.default)});return function(){var u=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r,c=arguments[1];if(c&&c.meta&&c.meta[d.default]){var f=c.meta[d.default];if(n&&t===f)return e(u,c);var a=e[f];if(a)return i({},u,o({},f,a(u[f],c)))}return u}}Object.defineProperty(t,"__esModule",{value:!0});var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t.default=u;var c=n(11),f=r(c),a=n(1),d=r(a),l=n(10),s=r(l)},function(e,t,n){function r(e){return null==e?void 0===e?f:c:a&&a in Object(e)?u(e):i(e)}var o=n(4),u=n(16),i=n(17),c="[object Null]",f="[object Undefined]",a=o?o.toStringTag:void 0;e.exports=r},function(e,t){(function(t){var n="object"==typeof t&&t&&t.Object===Object&&t;e.exports=n}).call(t,function(){return this}())},function(e,t,n){var r=n(18),o=r(Object.getPrototypeOf,Object);e.exports=o},function(e,t,n){function r(e){var t=i.call(e,f),n=e[f];try{e[f]=void 0;var r=!0}catch(e){}var o=c.call(e);return r&&(t?e[f]=n:delete e[f]),o}var o=n(4),u=Object.prototype,i=u.hasOwnProperty,c=u.toString,f=o?o.toStringTag:void 0;e.exports=r},function(e,t){function n(e){return o.call(e)}var r=Object.prototype,o=r.toString;e.exports=n},function(e,t){function n(e,t){return function(n){return e(t(n))}}e.exports=n},function(e,t,n){var r=n(14),o="object"==typeof self&&self&&self.Object===Object&&self,u=r||o||Function("return this")();e.exports=u},function(e,t){function n(e){return null!=e&&"object"==typeof e}e.exports=n},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return function(n,r,o){var i=e(n,r,o),f=i.dispatch,a=[],d={getState:i.getState,dispatch:function(e){return f(e)}};return a=t.map(function(e){return e(d)}),f=c.default.apply(void 0,a)(i.dispatch),u({},i,{dispatch:f})}}}t.__esModule=!0;var u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t.default=o;var i=n(6),c=r(i)},function(e,t){"use strict";function n(e,t){return function(){return t(e.apply(void 0,arguments))}}function r(e,t){if("function"==typeof e)return n(e,t);if("object"!=typeof e||null===e)throw new Error("bindActionCreators expected an object or a function, instead received "+(null===e?"null":typeof e)+'. Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?');for(var r=Object.keys(e),o={},u=0;u<r.length;u++){var i=r[u],c=e[i];"function"==typeof c&&(o[i]=n(c,t))}return o}t.__esModule=!0,t.default=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var n=t&&t.type,r=n&&'"'+n.toString()+'"'||"an action";return"Given action "+r+', reducer "'+e+'" returned undefined. To ignore an action, you must explicitly return the previous state.'}function u(e){Object.keys(e).forEach(function(t){var n=e[t],r=n(void 0,{type:c.ActionTypes.INIT});if("undefined"==typeof r)throw new Error('Reducer "'+t+'" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined.');var o="@@redux/PROBE_UNKNOWN_ACTION_"+Math.random().toString(36).substring(7).split("").join(".");if("undefined"==typeof n(void 0,{type:o}))throw new Error('Reducer "'+t+'" returned undefined when probed with a random type. '+("Don't try to handle "+c.ActionTypes.INIT+' or other actions in "redux/*" ')+"namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined.")})}function i(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++){var i=t[r];"function"==typeof e[i]&&(n[i]=e[i])}var c,f=Object.keys(n);try{u(n)}catch(e){c=e}return function(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],t=arguments[1];if(c)throw c;for(var r=!1,u={},i=0;i<f.length;i++){var a=f[i],d=n[a],l=e[a],s=d(l,t);if("undefined"==typeof s){var p=o(a,t);throw new Error(p)}u[a]=s,r=r||s!==l}return r?u:e}}t.__esModule=!0,t.default=i;var c=n(7),f=n(5),a=(r(f),n(8));r(a)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0,t.compose=t.applyMiddleware=t.bindActionCreators=t.combineReducers=t.createStore=void 0;var o=n(7),u=r(o),i=n(23),c=r(i),f=n(22),a=r(f),d=n(21),l=r(d),s=n(6),p=r(s),y=n(8);r(y);t.createStore=u.default,t.combineReducers=c.default,t.bindActionCreators=a.default,t.applyMiddleware=l.default,t.compose=p.default},function(e,t,n){e.exports=n(26)},function(e,t,n){(function(e,r){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var u,i=n(27),c=o(i);u="undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof e?e:r;var f=(0,c.default)(u);t.default=f}).call(t,function(){return this}(),n(28)(e))},function(e,t){"use strict";function n(e){var t,n=e.Symbol;return"function"==typeof n?n.observable?t=n.observable:(t=n("observable"),n.observable=t):t="@@observable",t}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children=[],e.webpackPolyfill=1),e}}])}); |
@@ -6,2 +6,3 @@ # API | ||
* [wrapDispatch](#wrapDispatch) | ||
* [wrapAction](#wrapAction) | ||
@@ -58,1 +59,27 @@ ## multireducer(reducers, [reducerKey]) | ||
``` | ||
## wrapAction(action, reducerKey) | ||
Wrap a Redux's `action` with given `reducerKey`. | ||
### Arguments | ||
* `action : Object [required]` | ||
Redux's action. | ||
* `reducerKey : String [required]` | ||
### Example | ||
```javascript | ||
import { wrapAction } from 'multireducer' | ||
// say we have a mapDispatchToProps function | ||
function mapDispatchToProps(dispatch) { | ||
return { | ||
onClick: () => dispatch(wrapAction({ type: 'SOME_ACTION' }, 'reducerKey')) | ||
} | ||
} | ||
``` |
@@ -37,3 +37,3 @@ 'use strict'; | ||
return function () { | ||
var state = arguments.length <= 0 || arguments[0] === undefined ? initialState : arguments[0]; | ||
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState; | ||
var action = arguments[1]; | ||
@@ -40,0 +40,0 @@ |
@@ -6,3 +6,3 @@ 'use strict'; | ||
}); | ||
exports.wrapDispatch = exports.bindActionCreators = undefined; | ||
exports.wrapAction = exports.wrapDispatch = exports.bindActionCreators = undefined; | ||
@@ -21,2 +21,6 @@ var _plainMultireducer = require('./plainMultireducer'); | ||
var _wrapAction = require('./wrapAction'); | ||
var _wrapAction2 = _interopRequireDefault(_wrapAction); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -26,2 +30,3 @@ | ||
exports.wrapDispatch = _wrapDispatch2.default; | ||
exports.wrapAction = _wrapAction2.default; | ||
exports.default = _plainMultireducer2.default; |
@@ -42,3 +42,3 @@ 'use strict'; | ||
return function () { | ||
var state = arguments.length <= 0 || arguments[0] === undefined ? initialState : arguments[0]; | ||
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState; | ||
var action = arguments[1]; | ||
@@ -45,0 +45,0 @@ |
@@ -7,3 +7,3 @@ 'use strict'; | ||
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; | ||
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
@@ -10,0 +10,0 @@ exports.default = wrapDispatch; |
{ | ||
"name": "multireducer", | ||
"version": "3.0.3", | ||
"version": "3.1.0", | ||
"description": "A utility to wrap many copies of a single Redux reducer into a single key-based reducer.", | ||
@@ -5,0 +5,0 @@ "main": "./lib/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
185652
27
1278