Comparing version 2.0.0 to 3.0.0
@@ -6,2 +6,12 @@ # Change log | ||
## [3.0.0](https://github.com/rackt/redux/compare/v2.0.0...v3.0.0) - 2015/09/13 | ||
### Breaking Changes | ||
* Action objects now must have a `type` property other than `undefined` ([#541](https://github.com/rackt/redux/issues/541), [#564](https://github.com/rackt/redux/pull/564)) | ||
### Other Changes | ||
* `replaceReducer()` is un-deprecated. | ||
## [2.0.0](https://github.com/rackt/redux/compare/v1.0.1...v2.0.0) - 2015/09/01 | ||
@@ -8,0 +18,0 @@ |
@@ -188,3 +188,5 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
* a good idea to keep actions serializable so you can record and replay user | ||
* sessions, or use the time travelling `redux-devtools`. | ||
* sessions, or use the time travelling `redux-devtools`. An action must have | ||
* a `type` property which may not be `undefined`. It is a good idea to use | ||
* string constants for action types. | ||
* | ||
@@ -198,5 +200,9 @@ * @returns {Object} For convenience, the same action object you dispatched. | ||
if (!_utilsIsPlainObject2['default'](action)) { | ||
throw new Error('Actions must be plain objects. Use custom middleware for async actions.'); | ||
throw new Error('Actions must be plain objects. ' + 'Use custom middleware for async actions.'); | ||
} | ||
if (typeof action.type === 'undefined') { | ||
throw new Error('Actions may not have an undefined "type" property. ' + 'Have you misspelled a constant?'); | ||
} | ||
if (isDispatching) { | ||
@@ -451,5 +457,5 @@ throw new Error('Reducers may not dispatch actions.'); | ||
if (typeof actionCreators !== 'object' || actionCreators == null) { | ||
if (typeof actionCreators !== 'object' || actionCreators === null || actionCreators === undefined) { | ||
// eslint-disable-line no-eq-null | ||
throw new Error('bindActionCreators expected an object or a function, instead received ' + typeof actionCreators + '. ' + 'Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?'); | ||
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"?'); | ||
} | ||
@@ -456,0 +462,0 @@ |
@@ -1,1 +0,1 @@ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Redux=e():t.Redux=e()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var u=n[r]={exports:{},id:r,loaded:!1};return t[r].call(u.exports,u,u.exports,e),u.loaded=!0,u.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}e.__esModule=!0;var u=n(1),o=r(u),i=n(7),a=r(i),c=n(6),f=r(c),d=n(5),s=r(d),l=n(2),p=r(l);e.createStore=o.default,e.combineReducers=a.default,e.bindActionCreators=f.default,e.applyMiddleware=s.default,e.compose=p.default},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function u(t,e){function n(){return f}function r(t){return d.push(t),function(){var e=d.indexOf(t);d.splice(e,1)}}function u(t){if(!i.default(t))throw new Error("Actions must be plain objects. Use custom middleware for async actions.");if(s)throw new Error("Reducers may not dispatch actions.");try{s=!0,f=c(f,t)}finally{s=!1}return d.slice().forEach(function(t){return t()}),t}function o(t){c=t,u({type:a.INIT})}if("function"!=typeof t)throw new Error("Expected the reducer to be a function.");var c=t,f=e,d=[],s=!1;return u({type:a.INIT}),{dispatch:u,subscribe:r,getState:n,replaceReducer:o}}e.__esModule=!0,e.default=u;var o=n(3),i=r(o),a={INIT:"@@redux/INIT"};e.ActionTypes=a},function(t,e){"use strict";function n(){for(var t=arguments.length,e=Array(t),n=0;t>n;n++)e[n]=arguments[n];return function(t){return e.reduceRight(function(t,e){return e(t)},t)}}e.__esModule=!0,e.default=n,t.exports=e.default},function(t,e){"use strict";function n(t){if(!t||"object"!=typeof t)return!1;var e="function"==typeof t.constructor?Object.getPrototypeOf(t):Object.prototype;if(null===e)return!0;var n=e.constructor;return"function"==typeof n&&n instanceof n&&r(n)===r(Object)}e.__esModule=!0,e.default=n;var r=function(t){return Function.prototype.toString.call(t)};t.exports=e.default},function(t,e){"use strict";function n(t,e){return Object.keys(t).reduce(function(n,r){return n[r]=e(t[r],r),n},{})}e.__esModule=!0,e.default=n,t.exports=e.default},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function u(){for(var t=arguments.length,e=Array(t),n=0;t>n;n++)e[n]=arguments[n];return function(t){return function(n,r){var u=t(n,r),i=u.dispatch,c=[],f={getState:u.getState,dispatch:function(t){return i(t)}};return c=e.map(function(t){return t(f)}),i=a.default.apply(void 0,c)(u.dispatch),o({},u,{dispatch:i})}}}e.__esModule=!0;var o=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t};e.default=u;var i=n(2),a=r(i);t.exports=e.default},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function u(t,e){return function(){return e(t.apply(void 0,arguments))}}function o(t,e){if("function"==typeof t)return u(t,e);if("object"!=typeof t||null==t)throw new Error("bindActionCreators expected an object or a function, instead received "+typeof t+'. Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?');return a.default(t,function(t){return u(t,e)})}e.__esModule=!0,e.default=o;var i=n(4),a=r(i);t.exports=e.default},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function u(t,e){var n=e&&e.type,r=n&&'"'+n.toString()+'"'||"an action";return'Reducer "'+t+'" returned undefined handling '+r+". To ignore an action, you must explicitly return the previous state."}function o(t){var e=s.default(t,function(t){return"function"==typeof t});Object.keys(e).forEach(function(t){var n=e[t];if("undefined"==typeof n(void 0,{type:i.ActionTypes.INIT}))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 r=Math.random().toString(36).substring(7).split("").join(".");if("undefined"==typeof n(void 0,{type:r}))throw new Error('Reducer "'+t+'" returned undefined when probed with a random type. '+("Don't try to handle "+i.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.")});var n=f.default(e,function(){return void 0});return function(t,r){void 0===t&&(t=n);var o=f.default(e,function(e,n){var o=e(t[n],r);if("undefined"==typeof o)throw new Error(u(n,r));return o});return o}}e.__esModule=!0,e.default=o;var i=n(1),a=n(3),c=(r(a),n(4)),f=r(c),d=n(8),s=r(d);t.exports=e.default},function(t,e){"use strict";function n(t,e){return Object.keys(t).reduce(function(n,r){return e(t[r])&&(n[r]=t[r]),n},{})}e.__esModule=!0,e.default=n,t.exports=e.default}])}); | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Redux=e():t.Redux=e()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return t[r].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}e.__esModule=!0;var o=n(1),u=r(o),i=n(7),a=r(i),f=n(6),c=r(f),d=n(5),s=r(d),l=n(2),p=r(l);e.createStore=u.default,e.combineReducers=a.default,e.bindActionCreators=c.default,e.applyMiddleware=s.default,e.compose=p.default},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){function n(){return c}function r(t){return d.push(t),function(){var e=d.indexOf(t);d.splice(e,1)}}function o(t){if(!i.default(t))throw new Error("Actions must be plain objects. Use custom middleware for async actions.");if("undefined"==typeof t.type)throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(s)throw new Error("Reducers may not dispatch actions.");try{s=!0,c=f(c,t)}finally{s=!1}return d.slice().forEach(function(t){return t()}),t}function u(t){f=t,o({type:a.INIT})}if("function"!=typeof t)throw new Error("Expected the reducer to be a function.");var f=t,c=e,d=[],s=!1;return o({type:a.INIT}),{dispatch:o,subscribe:r,getState:n,replaceReducer:u}}e.__esModule=!0,e.default=o;var u=n(3),i=r(u),a={INIT:"@@redux/INIT"};e.ActionTypes=a},function(t,e){"use strict";function n(){for(var t=arguments.length,e=Array(t),n=0;t>n;n++)e[n]=arguments[n];return function(t){return e.reduceRight(function(t,e){return e(t)},t)}}e.__esModule=!0,e.default=n,t.exports=e.default},function(t,e){"use strict";function n(t){if(!t||"object"!=typeof t)return!1;var e="function"==typeof t.constructor?Object.getPrototypeOf(t):Object.prototype;if(null===e)return!0;var n=e.constructor;return"function"==typeof n&&n instanceof n&&r(n)===r(Object)}e.__esModule=!0,e.default=n;var r=function(t){return Function.prototype.toString.call(t)};t.exports=e.default},function(t,e){"use strict";function n(t,e){return Object.keys(t).reduce(function(n,r){return n[r]=e(t[r],r),n},{})}e.__esModule=!0,e.default=n,t.exports=e.default},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function o(){for(var t=arguments.length,e=Array(t),n=0;t>n;n++)e[n]=arguments[n];return function(t){return function(n,r){var o=t(n,r),i=o.dispatch,f=[],c={getState:o.getState,dispatch:function(t){return i(t)}};return f=e.map(function(t){return t(c)}),i=a.default.apply(void 0,f)(o.dispatch),u({},o,{dispatch:i})}}}e.__esModule=!0;var u=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t};e.default=o;var i=n(2),a=r(i);t.exports=e.default},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){return function(){return e(t.apply(void 0,arguments))}}function u(t,e){if("function"==typeof t)return o(t,e);if("object"!=typeof t||null===t||void 0===t)throw new Error("bindActionCreators expected an object or a function, instead received "+(null===t?"null":typeof t)+'. Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?');return a.default(t,function(t){return o(t,e)})}e.__esModule=!0,e.default=u;var i=n(4),a=r(i);t.exports=e.default},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){var n=e&&e.type,r=n&&'"'+n.toString()+'"'||"an action";return'Reducer "'+t+'" returned undefined handling '+r+". To ignore an action, you must explicitly return the previous state."}function u(t){var e=s.default(t,function(t){return"function"==typeof t});Object.keys(e).forEach(function(t){var n=e[t];if("undefined"==typeof n(void 0,{type:i.ActionTypes.INIT}))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 r=Math.random().toString(36).substring(7).split("").join(".");if("undefined"==typeof n(void 0,{type:r}))throw new Error('Reducer "'+t+'" returned undefined when probed with a random type. '+("Don't try to handle "+i.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.")});var n=c.default(e,function(){return void 0});return function(t,r){void 0===t&&(t=n);var u=c.default(e,function(e,n){var u=e(t[n],r);if("undefined"==typeof u)throw new Error(o(n,r));return u});return u}}e.__esModule=!0,e.default=u;var i=n(1),a=n(3),f=(r(a),n(4)),c=r(f),d=n(8),s=r(d);t.exports=e.default},function(t,e){"use strict";function n(t,e){return Object.keys(t).reduce(function(n,r){return e(t[r])&&(n[r]=t[r]),n},{})}e.__esModule=!0,e.default=n,t.exports=e.default}])}); |
@@ -96,3 +96,5 @@ 'use strict'; | ||
* a good idea to keep actions serializable so you can record and replay user | ||
* sessions, or use the time travelling `redux-devtools`. | ||
* sessions, or use the time travelling `redux-devtools`. An action must have | ||
* a `type` property which may not be `undefined`. It is a good idea to use | ||
* string constants for action types. | ||
* | ||
@@ -106,5 +108,9 @@ * @returns {Object} For convenience, the same action object you dispatched. | ||
if (!_utilsIsPlainObject2['default'](action)) { | ||
throw new Error('Actions must be plain objects. Use custom middleware for async actions.'); | ||
throw new Error('Actions must be plain objects. ' + 'Use custom middleware for async actions.'); | ||
} | ||
if (typeof action.type === 'undefined') { | ||
throw new Error('Actions may not have an undefined "type" property. ' + 'Have you misspelled a constant?'); | ||
} | ||
if (isDispatching) { | ||
@@ -111,0 +117,0 @@ throw new Error('Reducers may not dispatch actions.'); |
@@ -45,5 +45,5 @@ 'use strict'; | ||
if (typeof actionCreators !== 'object' || actionCreators == null) { | ||
if (typeof actionCreators !== 'object' || actionCreators === null || actionCreators === undefined) { | ||
// eslint-disable-line no-eq-null | ||
throw new Error('bindActionCreators expected an object or a function, instead received ' + typeof actionCreators + '. ' + 'Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?'); | ||
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"?'); | ||
} | ||
@@ -50,0 +50,0 @@ |
{ | ||
"name": "redux", | ||
"version": "2.0.0", | ||
"version": "3.0.0", | ||
"description": "Predictable state container for JavaScript apps", | ||
@@ -25,4 +25,5 @@ "main": "lib/index.js", | ||
"docs:clean": "rimraf _book", | ||
"docs:build": "gitbook build -g rackt/redux", | ||
"docs:watch": "gitbook serve", | ||
"docs:prepare": "gitbook install", | ||
"docs:build": "npm run docs:prepare && gitbook build -g rackt/redux", | ||
"docs:watch": "npm run docs:prepare && gitbook serve", | ||
"docs:publish": "npm run docs:clean && npm run docs:build && cd _book && git init && git commit --allow-empty -m 'update book' && git checkout -b gh-pages && touch .nojekyll && git add . && git commit -am 'update book' && git push git@github.com:rackt/redux gh-pages --force" | ||
@@ -58,3 +59,2 @@ }, | ||
"babel-loader": "^5.1.4", | ||
"contextify": "^0.1.14", | ||
"eslint": "^1.2.1", | ||
@@ -65,2 +65,3 @@ "eslint-config-airbnb": "0.0.8", | ||
"gitbook-cli": "^0.3.4", | ||
"gitbook-plugin-prism": "^0.1.1", | ||
"isparta": "^3.0.3", | ||
@@ -67,0 +68,0 @@ "mocha": "^2.2.5", |
@@ -123,2 +123,4 @@ # [Redux](http://rackt.github.io/redux) | ||
For PDF, ePub, and MOBI exports for offline reading, and instructions on how to create them, please see: [paulwittmann/redux-offline-docs](https://github.com/paulwittmann/redux-offline-docs). | ||
### Examples | ||
@@ -125,0 +127,0 @@ |
@@ -85,3 +85,5 @@ import isPlainObject from './utils/isPlainObject'; | ||
* a good idea to keep actions serializable so you can record and replay user | ||
* sessions, or use the time travelling `redux-devtools`. | ||
* sessions, or use the time travelling `redux-devtools`. An action must have | ||
* a `type` property which may not be `undefined`. It is a good idea to use | ||
* string constants for action types. | ||
* | ||
@@ -95,5 +97,15 @@ * @returns {Object} For convenience, the same action object you dispatched. | ||
if (!isPlainObject(action)) { | ||
throw new Error('Actions must be plain objects. Use custom middleware for async actions.'); | ||
throw new Error( | ||
'Actions must be plain objects. ' + | ||
'Use custom middleware for async actions.' | ||
); | ||
} | ||
if (typeof action.type === 'undefined') { | ||
throw new Error( | ||
'Actions may not have an undefined "type" property. ' + | ||
'Have you misspelled a constant?' | ||
); | ||
} | ||
if (isDispatching) { | ||
@@ -100,0 +112,0 @@ throw new Error('Reducers may not dispatch actions.'); |
@@ -33,5 +33,5 @@ import mapValues from '../utils/mapValues'; | ||
if (typeof actionCreators !== 'object' || actionCreators == null) { // eslint-disable-line no-eq-null | ||
if (typeof actionCreators !== 'object' || actionCreators === null || actionCreators === undefined) { // eslint-disable-line no-eq-null | ||
throw new Error( | ||
`bindActionCreators expected an object or a function, instead received ${typeof actionCreators}. ` + | ||
`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"?` | ||
@@ -38,0 +38,0 @@ ); |
Sorry, the diff of this file is not supported yet
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
95736
1318
166