UNPKG

29.7 kBJavaScriptView Raw
1(function webpackUniversalModuleDefinition(root, factory) {
2 if(typeof exports === 'object' && typeof module === 'object')
3 module.exports = factory();
4 else if(typeof define === 'function' && define.amd)
5 define([], factory);
6 else if(typeof exports === 'object')
7 exports["Redux"] = factory();
8 else
9 root["Redux"] = factory();
10})(this, function() {
11return /******/ (function(modules) { // webpackBootstrap
12/******/ // The module cache
13/******/ var installedModules = {};
14
15/******/ // The require function
16/******/ function __webpack_require__(moduleId) {
17
18/******/ // Check if module is in cache
19/******/ if(installedModules[moduleId])
20/******/ return installedModules[moduleId].exports;
21
22/******/ // Create a new module (and put it into the cache)
23/******/ var module = installedModules[moduleId] = {
24/******/ exports: {},
25/******/ id: moduleId,
26/******/ loaded: false
27/******/ };
28
29/******/ // Execute the module function
30/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
31
32/******/ // Flag the module as loaded
33/******/ module.loaded = true;
34
35/******/ // Return the exports of the module
36/******/ return module.exports;
37/******/ }
38
39
40/******/ // expose the modules object (__webpack_modules__)
41/******/ __webpack_require__.m = modules;
42
43/******/ // expose the module cache
44/******/ __webpack_require__.c = installedModules;
45
46/******/ // __webpack_public_path__
47/******/ __webpack_require__.p = "";
48
49/******/ // Load entry module and return exports
50/******/ return __webpack_require__(0);
51/******/ })
52/************************************************************************/
53/******/ ([
54/* 0 */
55/***/ function(module, exports, __webpack_require__) {
56
57 'use strict';
58
59 exports.__esModule = true;
60 exports.compose = exports.applyMiddleware = exports.bindActionCreators = exports.combineReducers = exports.createStore = undefined;
61
62 var _createStore = __webpack_require__(2);
63
64 var _createStore2 = _interopRequireDefault(_createStore);
65
66 var _combineReducers = __webpack_require__(7);
67
68 var _combineReducers2 = _interopRequireDefault(_combineReducers);
69
70 var _bindActionCreators = __webpack_require__(6);
71
72 var _bindActionCreators2 = _interopRequireDefault(_bindActionCreators);
73
74 var _applyMiddleware = __webpack_require__(5);
75
76 var _applyMiddleware2 = _interopRequireDefault(_applyMiddleware);
77
78 var _compose = __webpack_require__(1);
79
80 var _compose2 = _interopRequireDefault(_compose);
81
82 var _warning = __webpack_require__(3);
83
84 var _warning2 = _interopRequireDefault(_warning);
85
86 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
87
88 /*
89 * This is a dummy function to check if the function name has been altered by minification.
90 * If the function has been minified and NODE_ENV !== 'production', warn the user.
91 */
92 function isCrushed() {}
93
94 if (("development") !== 'production' && typeof isCrushed.name === 'string' && isCrushed.name !== 'isCrushed') {
95 (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.');
96 }
97
98 exports.createStore = _createStore2["default"];
99 exports.combineReducers = _combineReducers2["default"];
100 exports.bindActionCreators = _bindActionCreators2["default"];
101 exports.applyMiddleware = _applyMiddleware2["default"];
102 exports.compose = _compose2["default"];
103
104/***/ },
105/* 1 */
106/***/ function(module, exports) {
107
108 "use strict";
109
110 exports.__esModule = true;
111 exports["default"] = compose;
112 /**
113 * Composes single-argument functions from right to left. The rightmost
114 * function can take multiple arguments as it provides the signature for
115 * the resulting composite function.
116 *
117 * @param {...Function} funcs The functions to compose.
118 * @returns {Function} A function obtained by composing the argument functions
119 * from right to left. For example, compose(f, g, h) is identical to doing
120 * (...args) => f(g(h(...args))).
121 */
122
123 function compose() {
124 for (var _len = arguments.length, funcs = Array(_len), _key = 0; _key < _len; _key++) {
125 funcs[_key] = arguments[_key];
126 }
127
128 if (funcs.length === 0) {
129 return function (arg) {
130 return arg;
131 };
132 } else {
133 var _ret = function () {
134 var last = funcs[funcs.length - 1];
135 var rest = funcs.slice(0, -1);
136 return {
137 v: function v() {
138 return rest.reduceRight(function (composed, f) {
139 return f(composed);
140 }, last.apply(undefined, arguments));
141 }
142 };
143 }();
144
145 if (typeof _ret === "object") return _ret.v;
146 }
147 }
148
149/***/ },
150/* 2 */
151/***/ function(module, exports, __webpack_require__) {
152
153 'use strict';
154
155 exports.__esModule = true;
156 exports.ActionTypes = undefined;
157 exports["default"] = createStore;
158
159 var _isPlainObject = __webpack_require__(4);
160
161 var _isPlainObject2 = _interopRequireDefault(_isPlainObject);
162
163 var _symbolObservable = __webpack_require__(11);
164
165 var _symbolObservable2 = _interopRequireDefault(_symbolObservable);
166
167 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
168
169 /**
170 * These are private action types reserved by Redux.
171 * For any unknown actions, you must return the current state.
172 * If the current state is undefined, you must return the initial state.
173 * Do not reference these action types directly in your code.
174 */
175 var ActionTypes = exports.ActionTypes = {
176 INIT: '@@redux/INIT'
177 };
178
179 /**
180 * Creates a Redux store that holds the state tree.
181 * The only way to change the data in the store is to call `dispatch()` on it.
182 *
183 * There should only be a single store in your app. To specify how different
184 * parts of the state tree respond to actions, you may combine several reducers
185 * into a single reducer function by using `combineReducers`.
186 *
187 * @param {Function} reducer A function that returns the next state tree, given
188 * the current state tree and the action to handle.
189 *
190 * @param {any} [initialState] The initial state. You may optionally specify it
191 * to hydrate the state from the server in universal apps, or to restore a
192 * previously serialized user session.
193 * If you use `combineReducers` to produce the root reducer function, this must be
194 * an object with the same shape as `combineReducers` keys.
195 *
196 * @param {Function} enhancer The store enhancer. You may optionally specify it
197 * to enhance the store with third-party capabilities such as middleware,
198 * time travel, persistence, etc. The only store enhancer that ships with Redux
199 * is `applyMiddleware()`.
200 *
201 * @returns {Store} A Redux store that lets you read the state, dispatch actions
202 * and subscribe to changes.
203 */
204 function createStore(reducer, initialState, enhancer) {
205 var _ref2;
206
207 if (typeof initialState === 'function' && typeof enhancer === 'undefined') {
208 enhancer = initialState;
209 initialState = undefined;
210 }
211
212 if (typeof enhancer !== 'undefined') {
213 if (typeof enhancer !== 'function') {
214 throw new Error('Expected the enhancer to be a function.');
215 }
216
217 return enhancer(createStore)(reducer, initialState);
218 }
219
220 if (typeof reducer !== 'function') {
221 throw new Error('Expected the reducer to be a function.');
222 }
223
224 var currentReducer = reducer;
225 var currentState = initialState;
226 var currentListeners = [];
227 var nextListeners = currentListeners;
228 var isDispatching = false;
229
230 function ensureCanMutateNextListeners() {
231 if (nextListeners === currentListeners) {
232 nextListeners = currentListeners.slice();
233 }
234 }
235
236 /**
237 * Reads the state tree managed by the store.
238 *
239 * @returns {any} The current state tree of your application.
240 */
241 function getState() {
242 return currentState;
243 }
244
245 /**
246 * Adds a change listener. It will be called any time an action is dispatched,
247 * and some part of the state tree may potentially have changed. You may then
248 * call `getState()` to read the current state tree inside the callback.
249 *
250 * You may call `dispatch()` from a change listener, with the following
251 * caveats:
252 *
253 * 1. The subscriptions are snapshotted just before every `dispatch()` call.
254 * If you subscribe or unsubscribe while the listeners are being invoked, this
255 * will not have any effect on the `dispatch()` that is currently in progress.
256 * However, the next `dispatch()` call, whether nested or not, will use a more
257 * recent snapshot of the subscription list.
258 *
259 * 2. The listener should not expect to see all state changes, as the state
260 * might have been updated multiple times during a nested `dispatch()` before
261 * the listener is called. It is, however, guaranteed that all subscribers
262 * registered before the `dispatch()` started will be called with the latest
263 * state by the time it exits.
264 *
265 * @param {Function} listener A callback to be invoked on every dispatch.
266 * @returns {Function} A function to remove this change listener.
267 */
268 function subscribe(listener) {
269 if (typeof listener !== 'function') {
270 throw new Error('Expected listener to be a function.');
271 }
272
273 var isSubscribed = true;
274
275 ensureCanMutateNextListeners();
276 nextListeners.push(listener);
277
278 return function unsubscribe() {
279 if (!isSubscribed) {
280 return;
281 }
282
283 isSubscribed = false;
284
285 ensureCanMutateNextListeners();
286 var index = nextListeners.indexOf(listener);
287 nextListeners.splice(index, 1);
288 };
289 }
290
291 /**
292 * Dispatches an action. It is the only way to trigger a state change.
293 *
294 * The `reducer` function, used to create the store, will be called with the
295 * current state tree and the given `action`. Its return value will
296 * be considered the **next** state of the tree, and the change listeners
297 * will be notified.
298 *
299 * The base implementation only supports plain object actions. If you want to
300 * dispatch a Promise, an Observable, a thunk, or something else, you need to
301 * wrap your store creating function into the corresponding middleware. For
302 * example, see the documentation for the `redux-thunk` package. Even the
303 * middleware will eventually dispatch plain object actions using this method.
304 *
305 * @param {Object} action A plain object representing “what changed”. It is
306 * a good idea to keep actions serializable so you can record and replay user
307 * sessions, or use the time travelling `redux-devtools`. An action must have
308 * a `type` property which may not be `undefined`. It is a good idea to use
309 * string constants for action types.
310 *
311 * @returns {Object} For convenience, the same action object you dispatched.
312 *
313 * Note that, if you use a custom middleware, it may wrap `dispatch()` to
314 * return something else (for example, a Promise you can await).
315 */
316 function dispatch(action) {
317 if (!(0, _isPlainObject2["default"])(action)) {
318 throw new Error('Actions must be plain objects. ' + 'Use custom middleware for async actions.');
319 }
320
321 if (typeof action.type === 'undefined') {
322 throw new Error('Actions may not have an undefined "type" property. ' + 'Have you misspelled a constant?');
323 }
324
325 if (isDispatching) {
326 throw new Error('Reducers may not dispatch actions.');
327 }
328
329 try {
330 isDispatching = true;
331 currentState = currentReducer(currentState, action);
332 } finally {
333 isDispatching = false;
334 }
335
336 var listeners = currentListeners = nextListeners;
337 for (var i = 0; i < listeners.length; i++) {
338 listeners[i]();
339 }
340
341 return action;
342 }
343
344 /**
345 * Replaces the reducer currently used by the store to calculate the state.
346 *
347 * You might need this if your app implements code splitting and you want to
348 * load some of the reducers dynamically. You might also need this if you
349 * implement a hot reloading mechanism for Redux.
350 *
351 * @param {Function} nextReducer The reducer for the store to use instead.
352 * @returns {void}
353 */
354 function replaceReducer(nextReducer) {
355 if (typeof nextReducer !== 'function') {
356 throw new Error('Expected the nextReducer to be a function.');
357 }
358
359 currentReducer = nextReducer;
360 dispatch({ type: ActionTypes.INIT });
361 }
362
363 /**
364 * Interoperability point for observable/reactive libraries.
365 * @returns {observable} A minimal observable of state changes.
366 * For more information, see the observable proposal:
367 * https://github.com/zenparsing/es-observable
368 */
369 function observable() {
370 var _ref;
371
372 var outerSubscribe = subscribe;
373 return _ref = {
374 /**
375 * The minimal observable subscription method.
376 * @param {Object} observer Any object that can be used as an observer.
377 * The observer object should have a `next` method.
378 * @returns {subscription} An object with an `unsubscribe` method that can
379 * be used to unsubscribe the observable from the store, and prevent further
380 * emission of values from the observable.
381 */
382
383 subscribe: function subscribe(observer) {
384 if (typeof observer !== 'object') {
385 throw new TypeError('Expected the observer to be an object.');
386 }
387
388 function observeState() {
389 if (observer.next) {
390 observer.next(getState());
391 }
392 }
393
394 observeState();
395 var unsubscribe = outerSubscribe(observeState);
396 return { unsubscribe: unsubscribe };
397 }
398 }, _ref[_symbolObservable2["default"]] = function () {
399 return this;
400 }, _ref;
401 }
402
403 // When a store is created, an "INIT" action is dispatched so that every
404 // reducer returns their initial state. This effectively populates
405 // the initial state tree.
406 dispatch({ type: ActionTypes.INIT });
407
408 return _ref2 = {
409 dispatch: dispatch,
410 subscribe: subscribe,
411 getState: getState,
412 replaceReducer: replaceReducer
413 }, _ref2[_symbolObservable2["default"]] = observable, _ref2;
414 }
415
416/***/ },
417/* 3 */
418/***/ function(module, exports) {
419
420 'use strict';
421
422 exports.__esModule = true;
423 exports["default"] = warning;
424 /**
425 * Prints a warning in the console if it exists.
426 *
427 * @param {String} message The warning message.
428 * @returns {void}
429 */
430 function warning(message) {
431 /* eslint-disable no-console */
432 if (typeof console !== 'undefined' && typeof console.error === 'function') {
433 console.error(message);
434 }
435 /* eslint-enable no-console */
436 try {
437 // This error was thrown as a convenience so that if you enable
438 // "break on all exceptions" in your console,
439 // it would pause the execution at this line.
440 throw new Error(message);
441 /* eslint-disable no-empty */
442 } catch (e) {}
443 /* eslint-enable no-empty */
444 }
445
446/***/ },
447/* 4 */
448/***/ function(module, exports, __webpack_require__) {
449
450 var getPrototype = __webpack_require__(8),
451 isHostObject = __webpack_require__(9),
452 isObjectLike = __webpack_require__(10);
453
454 /** `Object#toString` result references. */
455 var objectTag = '[object Object]';
456
457 /** Used for built-in method references. */
458 var objectProto = Object.prototype;
459
460 /** Used to resolve the decompiled source of functions. */
461 var funcToString = Function.prototype.toString;
462
463 /** Used to check objects for own properties. */
464 var hasOwnProperty = objectProto.hasOwnProperty;
465
466 /** Used to infer the `Object` constructor. */
467 var objectCtorString = funcToString.call(Object);
468
469 /**
470 * Used to resolve the
471 * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
472 * of values.
473 */
474 var objectToString = objectProto.toString;
475
476 /**
477 * Checks if `value` is a plain object, that is, an object created by the
478 * `Object` constructor or one with a `[[Prototype]]` of `null`.
479 *
480 * @static
481 * @memberOf _
482 * @since 0.8.0
483 * @category Lang
484 * @param {*} value The value to check.
485 * @returns {boolean} Returns `true` if `value` is a plain object,
486 * else `false`.
487 * @example
488 *
489 * function Foo() {
490 * this.a = 1;
491 * }
492 *
493 * _.isPlainObject(new Foo);
494 * // => false
495 *
496 * _.isPlainObject([1, 2, 3]);
497 * // => false
498 *
499 * _.isPlainObject({ 'x': 0, 'y': 0 });
500 * // => true
501 *
502 * _.isPlainObject(Object.create(null));
503 * // => true
504 */
505 function isPlainObject(value) {
506 if (!isObjectLike(value) ||
507 objectToString.call(value) != objectTag || isHostObject(value)) {
508 return false;
509 }
510 var proto = getPrototype(value);
511 if (proto === null) {
512 return true;
513 }
514 var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
515 return (typeof Ctor == 'function' &&
516 Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString);
517 }
518
519 module.exports = isPlainObject;
520
521
522/***/ },
523/* 5 */
524/***/ function(module, exports, __webpack_require__) {
525
526 'use strict';
527
528 exports.__esModule = true;
529
530 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; };
531
532 exports["default"] = applyMiddleware;
533
534 var _compose = __webpack_require__(1);
535
536 var _compose2 = _interopRequireDefault(_compose);
537
538 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
539
540 /**
541 * Creates a store enhancer that applies middleware to the dispatch method
542 * of the Redux store. This is handy for a variety of tasks, such as expressing
543 * asynchronous actions in a concise manner, or logging every action payload.
544 *
545 * See `redux-thunk` package as an example of the Redux middleware.
546 *
547 * Because middleware is potentially asynchronous, this should be the first
548 * store enhancer in the composition chain.
549 *
550 * Note that each middleware will be given the `dispatch` and `getState` functions
551 * as named arguments.
552 *
553 * @param {...Function} middlewares The middleware chain to be applied.
554 * @returns {Function} A store enhancer applying the middleware.
555 */
556 function applyMiddleware() {
557 for (var _len = arguments.length, middlewares = Array(_len), _key = 0; _key < _len; _key++) {
558 middlewares[_key] = arguments[_key];
559 }
560
561 return function (createStore) {
562 return function (reducer, initialState, enhancer) {
563 var store = createStore(reducer, initialState, enhancer);
564 var _dispatch = store.dispatch;
565 var chain = [];
566
567 var middlewareAPI = {
568 getState: store.getState,
569 dispatch: function dispatch(action) {
570 return _dispatch(action);
571 }
572 };
573 chain = middlewares.map(function (middleware) {
574 return middleware(middlewareAPI);
575 });
576 _dispatch = _compose2["default"].apply(undefined, chain)(store.dispatch);
577
578 return _extends({}, store, {
579 dispatch: _dispatch
580 });
581 };
582 };
583 }
584
585/***/ },
586/* 6 */
587/***/ function(module, exports) {
588
589 'use strict';
590
591 exports.__esModule = true;
592 exports["default"] = bindActionCreators;
593 function bindActionCreator(actionCreator, dispatch) {
594 return function () {
595 return dispatch(actionCreator.apply(undefined, arguments));
596 };
597 }
598
599 /**
600 * Turns an object whose values are action creators, into an object with the
601 * same keys, but with every function wrapped into a `dispatch` call so they
602 * may be invoked directly. This is just a convenience method, as you can call
603 * `store.dispatch(MyActionCreators.doSomething())` yourself just fine.
604 *
605 * For convenience, you can also pass a single function as the first argument,
606 * and get a function in return.
607 *
608 * @param {Function|Object} actionCreators An object whose values are action
609 * creator functions. One handy way to obtain it is to use ES6 `import * as`
610 * syntax. You may also pass a single function.
611 *
612 * @param {Function} dispatch The `dispatch` function available on your Redux
613 * store.
614 *
615 * @returns {Function|Object} The object mimicking the original object, but with
616 * every action creator wrapped into the `dispatch` call. If you passed a
617 * function as `actionCreators`, the return value will also be a single
618 * function.
619 */
620 function bindActionCreators(actionCreators, dispatch) {
621 if (typeof actionCreators === 'function') {
622 return bindActionCreator(actionCreators, dispatch);
623 }
624
625 if (typeof actionCreators !== 'object' || actionCreators === null) {
626 throw new Error('bindActionCreators expected an object or a function, instead received ' + (actionCreators === null ? 'null' : typeof actionCreators) + '. ' + 'Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?');
627 }
628
629 var keys = Object.keys(actionCreators);
630 var boundActionCreators = {};
631 for (var i = 0; i < keys.length; i++) {
632 var key = keys[i];
633 var actionCreator = actionCreators[key];
634 if (typeof actionCreator === 'function') {
635 boundActionCreators[key] = bindActionCreator(actionCreator, dispatch);
636 }
637 }
638 return boundActionCreators;
639 }
640
641/***/ },
642/* 7 */
643/***/ function(module, exports, __webpack_require__) {
644
645 'use strict';
646
647 exports.__esModule = true;
648 exports["default"] = combineReducers;
649
650 var _createStore = __webpack_require__(2);
651
652 var _isPlainObject = __webpack_require__(4);
653
654 var _isPlainObject2 = _interopRequireDefault(_isPlainObject);
655
656 var _warning = __webpack_require__(3);
657
658 var _warning2 = _interopRequireDefault(_warning);
659
660 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
661
662 function getUndefinedStateErrorMessage(key, action) {
663 var actionType = action && action.type;
664 var actionName = actionType && '"' + actionType.toString() + '"' || 'an action';
665
666 return 'Given action ' + actionName + ', reducer "' + key + '" returned undefined. ' + 'To ignore an action, you must explicitly return the previous state.';
667 }
668
669 function getUnexpectedStateShapeWarningMessage(inputState, reducers, action) {
670 var reducerKeys = Object.keys(reducers);
671 var argumentName = action && action.type === _createStore.ActionTypes.INIT ? 'initialState argument passed to createStore' : 'previous state received by the reducer';
672
673 if (reducerKeys.length === 0) {
674 return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.';
675 }
676
677 if (!(0, _isPlainObject2["default"])(inputState)) {
678 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('", "') + '"');
679 }
680
681 var unexpectedKeys = Object.keys(inputState).filter(function (key) {
682 return !reducers.hasOwnProperty(key);
683 });
684
685 if (unexpectedKeys.length > 0) {
686 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.');
687 }
688 }
689
690 function assertReducerSanity(reducers) {
691 Object.keys(reducers).forEach(function (key) {
692 var reducer = reducers[key];
693 var initialState = reducer(undefined, { type: _createStore.ActionTypes.INIT });
694
695 if (typeof initialState === 'undefined') {
696 throw new Error('Reducer "' + key + '" 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.');
697 }
698
699 var type = '@@redux/PROBE_UNKNOWN_ACTION_' + Math.random().toString(36).substring(7).split('').join('.');
700 if (typeof reducer(undefined, { type: type }) === 'undefined') {
701 throw new Error('Reducer "' + key + '" returned undefined when probed with a random type. ' + ('Don\'t try to handle ' + _createStore.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.');
702 }
703 });
704 }
705
706 /**
707 * Turns an object whose values are different reducer functions, into a single
708 * reducer function. It will call every child reducer, and gather their results
709 * into a single state object, whose keys correspond to the keys of the passed
710 * reducer functions.
711 *
712 * @param {Object} reducers An object whose values correspond to different
713 * reducer functions that need to be combined into one. One handy way to obtain
714 * it is to use ES6 `import * as reducers` syntax. The reducers may never return
715 * undefined for any action. Instead, they should return their initial state
716 * if the state passed to them was undefined, and the current state for any
717 * unrecognized action.
718 *
719 * @returns {Function} A reducer function that invokes every reducer inside the
720 * passed object, and builds a state object with the same shape.
721 */
722 function combineReducers(reducers) {
723 var reducerKeys = Object.keys(reducers);
724 var finalReducers = {};
725 for (var i = 0; i < reducerKeys.length; i++) {
726 var key = reducerKeys[i];
727 if (typeof reducers[key] === 'function') {
728 finalReducers[key] = reducers[key];
729 }
730 }
731 var finalReducerKeys = Object.keys(finalReducers);
732
733 var sanityError;
734 try {
735 assertReducerSanity(finalReducers);
736 } catch (e) {
737 sanityError = e;
738 }
739
740 return function combination() {
741 var state = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
742 var action = arguments[1];
743
744 if (sanityError) {
745 throw sanityError;
746 }
747
748 if (true) {
749 var warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action);
750 if (warningMessage) {
751 (0, _warning2["default"])(warningMessage);
752 }
753 }
754
755 var hasChanged = false;
756 var nextState = {};
757 for (var i = 0; i < finalReducerKeys.length; i++) {
758 var key = finalReducerKeys[i];
759 var reducer = finalReducers[key];
760 var previousStateForKey = state[key];
761 var nextStateForKey = reducer(previousStateForKey, action);
762 if (typeof nextStateForKey === 'undefined') {
763 var errorMessage = getUndefinedStateErrorMessage(key, action);
764 throw new Error(errorMessage);
765 }
766 nextState[key] = nextStateForKey;
767 hasChanged = hasChanged || nextStateForKey !== previousStateForKey;
768 }
769 return hasChanged ? nextState : state;
770 };
771 }
772
773/***/ },
774/* 8 */
775/***/ function(module, exports) {
776
777 /* Built-in method references for those with the same name as other `lodash` methods. */
778 var nativeGetPrototype = Object.getPrototypeOf;
779
780 /**
781 * Gets the `[[Prototype]]` of `value`.
782 *
783 * @private
784 * @param {*} value The value to query.
785 * @returns {null|Object} Returns the `[[Prototype]]`.
786 */
787 function getPrototype(value) {
788 return nativeGetPrototype(Object(value));
789 }
790
791 module.exports = getPrototype;
792
793
794/***/ },
795/* 9 */
796/***/ function(module, exports) {
797
798 /**
799 * Checks if `value` is a host object in IE < 9.
800 *
801 * @private
802 * @param {*} value The value to check.
803 * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
804 */
805 function isHostObject(value) {
806 // Many host objects are `Object` objects that can coerce to strings
807 // despite having improperly defined `toString` methods.
808 var result = false;
809 if (value != null && typeof value.toString != 'function') {
810 try {
811 result = !!(value + '');
812 } catch (e) {}
813 }
814 return result;
815 }
816
817 module.exports = isHostObject;
818
819
820/***/ },
821/* 10 */
822/***/ function(module, exports) {
823
824 /**
825 * Checks if `value` is object-like. A value is object-like if it's not `null`
826 * and has a `typeof` result of "object".
827 *
828 * @static
829 * @memberOf _
830 * @since 4.0.0
831 * @category Lang
832 * @param {*} value The value to check.
833 * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
834 * @example
835 *
836 * _.isObjectLike({});
837 * // => true
838 *
839 * _.isObjectLike([1, 2, 3]);
840 * // => true
841 *
842 * _.isObjectLike(_.noop);
843 * // => false
844 *
845 * _.isObjectLike(null);
846 * // => false
847 */
848 function isObjectLike(value) {
849 return !!value && typeof value == 'object';
850 }
851
852 module.exports = isObjectLike;
853
854
855/***/ },
856/* 11 */
857/***/ function(module, exports, __webpack_require__) {
858
859 /* WEBPACK VAR INJECTION */(function(global) {/* global window */
860 'use strict';
861
862 module.exports = __webpack_require__(12)(global || window || this);
863
864 /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
865
866/***/ },
867/* 12 */
868/***/ function(module, exports) {
869
870 'use strict';
871
872 module.exports = function symbolObservablePonyfill(root) {
873 var result;
874 var Symbol = root.Symbol;
875
876 if (typeof Symbol === 'function') {
877 if (Symbol.observable) {
878 result = Symbol.observable;
879 } else {
880 if (typeof Symbol['for'] === 'function') {
881 result = Symbol['for']('observable');
882 } else {
883 result = Symbol('observable');
884 }
885 Symbol.observable = result;
886 }
887 } else {
888 result = '@@observable';
889 }
890
891 return result;
892 };
893
894
895/***/ }
896/******/ ])
897});
898;
\No newline at end of file