@mad_gooze/redux-unsafe
Advanced tools
Comparing version
@@ -317,4 +317,6 @@ (function (global, factory) { | ||
subscribe: function subscribe(observer) { | ||
if ( typeof observer !== 'object' || observer === null) { | ||
throw new TypeError('Expected the observer to be an object.'); | ||
{ | ||
if (typeof observer !== 'object' || observer === null) { | ||
throw new TypeError('Expected the observer to be an object.'); | ||
} | ||
} | ||
@@ -506,3 +508,3 @@ | ||
if (typeof nextStateForKey === 'undefined') { | ||
if ( typeof nextStateForKey === 'undefined') { | ||
var errorMessage = getUndefinedStateErrorMessage(_key, action); | ||
@@ -509,0 +511,0 @@ throw new Error(errorMessage); |
@@ -1,1 +0,1 @@ | ||
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e=e||self).Redux={})}(this,function(e){"use strict";var n=function(e){var n,t=e.Symbol;return"function"==typeof t?t.observable?n=t.observable:(n=t("observable"),t.observable=n):n="@@observable",n}("undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof module?module:Function("return this")()),t=function(){return Math.random().toString(36).substring(7).split("").join(".")},r={INIT:"@@redux/INIT"+t(),REPLACE:"@@redux/REPLACE"+t(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+t()}};function o(e,n){var t=n&&n.type;return"Given "+(t&&'action "'+t+'"'||"an action")+', reducer "'+e+'" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.'}function u(e,n){return function(){return n(e.apply(this,arguments))}}function i(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function c(e,n){var t=Object.keys(e);return Object.getOwnPropertySymbols&&t.push.apply(t,Object.getOwnPropertySymbols(e)),n&&(t=t.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t}function f(e){for(var n=1;arguments.length>n;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?c(t,!0).forEach(function(n){i(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):c(t).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function a(){for(var e=arguments.length,n=Array(e),t=0;e>t;t++)n[t]=arguments[t];return 0===n.length?function(e){return e}:1===n.length?n[0]:n.reduce(function(e,n){return function(){return e(n.apply(void 0,arguments))}})}e.__DO_NOT_USE__ActionTypes=r,e.applyMiddleware=function(){for(var e=arguments.length,n=Array(e),t=0;e>t;t++)n[t]=arguments[t];return function(e){return function(){var t,r=e.apply(void 0,arguments),o={getState:r.getState,dispatch:function(){return t.apply(void 0,arguments)}},u=n.map(function(e){return e(o)});return f({},r,{dispatch:t=a.apply(void 0,u)(r.dispatch)})}}},e.bindActionCreators=function(e,n){if("function"==typeof e)return u(e,n);var t={};for(var r in e){var o=e[r];"function"==typeof o&&(t[r]=u(o,n))}return t},e.combineReducers=function(e){for(var n=Object.keys(e),t={},r=0;n.length>r;r++){var u=n[r];"function"==typeof e[u]&&(t[u]=e[u])}var i=Object.keys(t);return function(e,n){void 0===e&&(e={});for(var r=!1,u={},c=0;i.length>c;c++){var f=i[c],a=e[f],p=(0,t[f])(a,n);if(void 0===p){var l=o(f,n);throw Error(l)}u[f]=p,r=r||p!==a}return r?u:e}},e.compose=a,e.createStore=function e(t,o,u){var i;if("function"==typeof o&&void 0===u&&(u=o,o=void 0),void 0!==u)return u(e)(t,o);var c=t,f=o,a=[],p=a;function l(){p===a&&(p=a.slice())}function d(){return f}function s(e){var n=!0;return l(),p.push(e),function(){if(n){n=!1,l();var t=p.indexOf(e);p.splice(t,1),a=null}}}function y(e){try{f=c(f,e)}finally{}for(var n=a=p,t=0;n.length>t;t++)(0,n[t])();return e}return y({type:r.INIT}),(i={dispatch:y,subscribe:s,getState:d,replaceReducer:function(e){c=e,y({type:r.REPLACE})}})[n]=function(){var e,t=s;return(e={subscribe:function(e){if(null===e)throw new TypeError("Expected the observer to be an object.");function n(){e.next&&e.next(d())}return n(),{unsubscribe:t(n)}}})[n]=function(){return this},e},i},Object.defineProperty(e,"__esModule",{value:!0})}); | ||
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e=e||self).Redux={})}(this,function(e){"use strict";var n=function(e){var n,t=e.Symbol;return"function"==typeof t?t.observable?n=t.observable:(n=t("observable"),t.observable=n):n="@@observable",n}("undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof module?module:Function("return this")()),t=function(){return Math.random().toString(36).substring(7).split("").join(".")},r={INIT:"@@redux/INIT"+t(),REPLACE:"@@redux/REPLACE"+t(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+t()}};function o(e,n){return function(){return n(e.apply(this,arguments))}}function u(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function i(e,n){var t=Object.keys(e);return Object.getOwnPropertySymbols&&t.push.apply(t,Object.getOwnPropertySymbols(e)),n&&(t=t.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t}function f(e){for(var n=1;arguments.length>n;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?i(t,!0).forEach(function(n){u(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):i(t).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function c(){for(var e=arguments.length,n=Array(e),t=0;e>t;t++)n[t]=arguments[t];return 0===n.length?function(e){return e}:1===n.length?n[0]:n.reduce(function(e,n){return function(){return e(n.apply(void 0,arguments))}})}e.__DO_NOT_USE__ActionTypes=r,e.applyMiddleware=function(){for(var e=arguments.length,n=Array(e),t=0;e>t;t++)n[t]=arguments[t];return function(e){return function(){var t,r=e.apply(void 0,arguments),o={getState:r.getState,dispatch:function(){return t.apply(void 0,arguments)}},u=n.map(function(e){return e(o)});return f({},r,{dispatch:t=c.apply(void 0,u)(r.dispatch)})}}},e.bindActionCreators=function(e,n){if("function"==typeof e)return o(e,n);var t={};for(var r in e){var u=e[r];"function"==typeof u&&(t[r]=o(u,n))}return t},e.combineReducers=function(e){for(var n=Object.keys(e),t={},r=0;n.length>r;r++){var o=n[r];"function"==typeof e[o]&&(t[o]=e[o])}var u=Object.keys(t);return function(e,n){void 0===e&&(e={});for(var r=!1,o={},i=0;u.length>i;i++){var f=u[i],c=e[f],a=(0,t[f])(c,n);o[f]=a,r=r||a!==c}return r?o:e}},e.compose=c,e.createStore=function e(t,o,u){var i;if("function"==typeof o&&void 0===u&&(u=o,o=void 0),void 0!==u)return u(e)(t,o);var f=t,c=o,a=[],p=a;function l(){p===a&&(p=a.slice())}function s(){return c}function d(e){var n=!0;return l(),p.push(e),function(){if(n){n=!1,l();var t=p.indexOf(e);p.splice(t,1),a=null}}}function b(e){try{c=f(c,e)}finally{}for(var n=a=p,t=0;n.length>t;t++)(0,n[t])();return e}return b({type:r.INIT}),(i={dispatch:b,subscribe:d,getState:s,replaceReducer:function(e){f=e,b({type:r.REPLACE})}})[n]=function(){var e,t=d;return(e={subscribe:function(e){function n(){e.next&&e.next(s())}return n(),{unsubscribe:t(n)}}})[n]=function(){return this},e},i},Object.defineProperty(e,"__esModule",{value:!0})}); |
@@ -277,4 +277,6 @@ import $$observable from 'symbol-observable'; | ||
subscribe: function subscribe(observer) { | ||
if (process.env.NODE_ENV !== 'production' && typeof observer !== 'object' || observer === null) { | ||
throw new TypeError('Expected the observer to be an object.'); | ||
if (process.env.NODE_ENV !== 'production') { | ||
if (typeof observer !== 'object' || observer === null) { | ||
throw new TypeError('Expected the observer to be an object.'); | ||
} | ||
} | ||
@@ -466,3 +468,3 @@ | ||
if (typeof nextStateForKey === 'undefined') { | ||
if (process.env.NODE_ENV !== 'production' && typeof nextStateForKey === 'undefined') { | ||
var errorMessage = getUndefinedStateErrorMessage(_key, action); | ||
@@ -469,0 +471,0 @@ throw new Error(errorMessage); |
@@ -283,4 +283,6 @@ 'use strict'; | ||
subscribe: function subscribe(observer) { | ||
if (process.env.NODE_ENV !== 'production' && typeof observer !== 'object' || observer === null) { | ||
throw new TypeError('Expected the observer to be an object.'); | ||
if (process.env.NODE_ENV !== 'production') { | ||
if (typeof observer !== 'object' || observer === null) { | ||
throw new TypeError('Expected the observer to be an object.'); | ||
} | ||
} | ||
@@ -472,3 +474,3 @@ | ||
if (typeof nextStateForKey === 'undefined') { | ||
if (process.env.NODE_ENV !== 'production' && typeof nextStateForKey === 'undefined') { | ||
var errorMessage = getUndefinedStateErrorMessage(_key, action); | ||
@@ -475,0 +477,0 @@ throw new Error(errorMessage); |
{ | ||
"name": "@mad_gooze/redux-unsafe", | ||
"version": "4.0.5-0", | ||
"version": "4.0.5-1", | ||
"description": "Predictable state container for JavaScript apps", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -171,3 +171,6 @@ import ActionTypes from './utils/actionTypes' | ||
const nextStateForKey = reducer(previousStateForKey, action) | ||
if (typeof nextStateForKey === 'undefined') { | ||
if ( | ||
process.env.NODE_ENV !== 'production' && | ||
typeof nextStateForKey === 'undefined' | ||
) { | ||
const errorMessage = getUndefinedStateErrorMessage(key, action) | ||
@@ -174,0 +177,0 @@ throw new Error(errorMessage) |
@@ -276,8 +276,6 @@ import $$observable from 'symbol-observable' | ||
subscribe(observer) { | ||
if ( | ||
(process.env.NODE_ENV !== 'production' && | ||
typeof observer !== 'object') || | ||
observer === null | ||
) { | ||
throw new TypeError('Expected the observer to be an object.') | ||
if (process.env.NODE_ENV !== 'production') { | ||
if (typeof observer !== 'object' || observer === null) { | ||
throw new TypeError('Expected the observer to be an object.') | ||
} | ||
} | ||
@@ -284,0 +282,0 @@ |
Sorry, the diff of this file is not supported yet
2962
0.14%155612
-0.37%63
5%