@acpaas-ui/js-redux-utils
Advanced tools
Comparing version 1.0.1-alpha.2 to 1.0.1-alpha.3
@@ -1,2 +0,2 @@ | ||
define(["exports"],function(exports){"use strict";var verifyAction=function(type,action){return!!(type&&action&&action.type)&&(type="/"!==type.slice(-1)?type+"/":type,0===action.type.indexOf(type))},noopReducer=function(state){return state},progressReducer=function(){var type=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",reducer=arguments.length>1&&void 0!==arguments[1]?arguments[1]:noopReducer;return function(){var state=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{loading:!1,created:null,lastUpdated:null,error:null,result:null},_ref=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},_ref$err=_ref.err,err=void 0===_ref$err?null:_ref$err,_ref$loading=_ref.loading,loading=void 0!==_ref$loading&&_ref$loading,action=babelHelpers.objectWithoutProperties(_ref,["err","loading"]);if(!verifyAction(type,action))return state;var resultState=state?state.result:null,createdState=state?state.created:null,lastUpdatedState=state?state.lastUpdated:null,newState=loading||null!==err?null:reducer(resultState,action);return{loading:loading,created:createdState||new Date,lastUpdated:lastUpdatedState&&newState===resultState?lastUpdatedState:new Date,error:err,result:newState}}},reducer=function(_ref3,initialState){var type=_ref3.type,dataType=_ref3.dataType;return function(){var state=arguments.length>0&&void 0!==arguments[0]?arguments[0]:initialState,action=arguments[1];return function(state,action,_ref,_ref2){var actionLoad=_ref.actionLoad,actionLoadMore=_ref.actionLoadMore,actionClear=_ref.actionClear,dataType=_ref2.dataType;return action.type===actionLoad?action.data:action.type===actionLoadMore?"list"===dataType?[].concat(babelHelpers.toConsumableArray(state),babelHelpers.toConsumableArray(action.data)):action.data:action.type===actionClear?"list"===dataType?[]:null:state}(void 0!==state?state:"list"===dataType?[]:null,action,function(type){var upperType=type.toUpperCase().replace(/\s/g,"");return{actionLoad:upperType+"/LOAD",actionLoadMore:upperType+"/LOAD_MORE",actionClear:upperType+"/CLEAR"}}(type),{type:type,dataType:dataType})}};exports.progressReducer=progressReducer,exports.targetReducer=function(){var _ref=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},_ref$type=_ref.type,type=void 0===_ref$type?"":_ref$type,_ref$progress=_ref.progress,progress=void 0!==_ref$progress&&_ref$progress,reducer=arguments.length>1&&void 0!==arguments[1]?arguments[1]:noopReducer,initialState=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return function(){var state=arguments.length>0&&void 0!==arguments[0]?arguments[0]:initialState,action=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return verifyAction(type,action)&&action.target?babelHelpers.extends({},state,babelHelpers.defineProperty({},action.target,progress?progressReducer(type,reducer)(state,action):reducer(state,action))):state}},exports.basicTypeReducer=function(){var _ref4=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},_ref4$type=_ref4.type,type=void 0===_ref4$type?"BASIC_DEFAULT":_ref4$type,_ref4$progress=_ref4.progress,progress=void 0!==_ref4$progress&&_ref4$progress,_ref4$dataType=_ref4.dataType,dataType=void 0===_ref4$dataType?"single":_ref4$dataType,initialState=arguments[1],wrappedReducer=reducer({type:type,dataType:dataType},initialState);return progress&&(wrappedReducer=progressReducer(type,wrappedReducer)),wrappedReducer},Object.defineProperty(exports,"__esModule",{value:!0})}); | ||
define(["exports"],function(exports){"use strict";var verifyAction=function(type,action){return!!(type&&action&&action.type)&&(type="/"!==type.slice(-1)?type+"/":type,0===action.type.indexOf(type))},noopReducer=function(state){return state},_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},toConsumableArray=function(arr){if(Array.isArray(arr)){for(var i=0,arr2=Array(arr.length);i<arr.length;i++)arr2[i]=arr[i];return arr2}return Array.from(arr)},progressReducer=function(){var type=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",reducer=arguments.length>1&&void 0!==arguments[1]?arguments[1]:noopReducer;return function(){var state=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{loading:!1,created:null,lastUpdated:null,error:null,result:null},_ref=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},_ref$err=_ref.err,err=void 0===_ref$err?null:_ref$err,_ref$loading=_ref.loading,loading=void 0!==_ref$loading&&_ref$loading,action=function(obj,keys){var target={};for(var i in obj)keys.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(obj,i)&&(target[i]=obj[i]);return target}(_ref,["err","loading"]);if(!verifyAction(type,action))return state;var resultState=state?state.result:null,createdState=state?state.created:null,lastUpdatedState=state?state.lastUpdated:null,newState=loading||null!==err?null:reducer(resultState,action);return{loading:loading,created:createdState||new Date,lastUpdated:lastUpdatedState&&newState===resultState?lastUpdatedState:new Date,error:err,result:newState}}},reducer=function(_ref3,initialState){var type=_ref3.type,dataType=_ref3.dataType;return function(){var state=arguments.length>0&&void 0!==arguments[0]?arguments[0]:initialState,action=arguments[1];return function(state,action,_ref,_ref2){var actionLoad=_ref.actionLoad,actionLoadMore=_ref.actionLoadMore,actionClear=_ref.actionClear,dataType=_ref2.dataType;return action.type===actionLoad?action.data:action.type===actionLoadMore?"list"===dataType?[].concat(toConsumableArray(state),toConsumableArray(action.data)):action.data:action.type===actionClear?"list"===dataType?[]:null:state}(void 0!==state?state:"list"===dataType?[]:null,action,function(type){var upperType=type.toUpperCase().replace(/\s/g,"");return{actionLoad:upperType+"/LOAD",actionLoadMore:upperType+"/LOAD_MORE",actionClear:upperType+"/CLEAR"}}(type),{type:type,dataType:dataType})}};exports.progressReducer=progressReducer,exports.targetReducer=function(){var _ref=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},_ref$type=_ref.type,type=void 0===_ref$type?"":_ref$type,_ref$progress=_ref.progress,progress=void 0!==_ref$progress&&_ref$progress,reducer=arguments.length>1&&void 0!==arguments[1]?arguments[1]:noopReducer,initialState=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return function(){var obj,key,value,state=arguments.length>0&&void 0!==arguments[0]?arguments[0]:initialState,action=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return verifyAction(type,action)&&action.target?_extends({},state,(obj={},key=action.target,value=progress?progressReducer(type,reducer)(state,action):reducer(state,action),key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj)):state}},exports.basicTypeReducer=function(){var _ref4=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},_ref4$type=_ref4.type,type=void 0===_ref4$type?"BASIC_DEFAULT":_ref4$type,_ref4$progress=_ref4.progress,progress=void 0!==_ref4$progress&&_ref4$progress,_ref4$dataType=_ref4.dataType,dataType=void 0===_ref4$dataType?"single":_ref4$dataType,initialState=arguments[1],wrappedReducer=reducer({type:type,dataType:dataType},initialState);return progress&&(wrappedReducer=progressReducer(type,wrappedReducer)),wrappedReducer},Object.defineProperty(exports,"__esModule",{value:!0})}); | ||
//# sourceMappingURL=acpaas-ui-js-redux-utils.amd.js.map |
@@ -1,2 +0,2 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var verifyAction=function(type,action){return!!(type&&action&&action.type)&&(type="/"!==type.slice(-1)?type+"/":type,0===action.type.indexOf(type))},noopReducer=function(state){return state},progressReducer=function(){var type=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",reducer=arguments.length>1&&void 0!==arguments[1]?arguments[1]:noopReducer;return function(){var state=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{loading:!1,created:null,lastUpdated:null,error:null,result:null},_ref=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},_ref$err=_ref.err,err=void 0===_ref$err?null:_ref$err,_ref$loading=_ref.loading,loading=void 0!==_ref$loading&&_ref$loading,action=babelHelpers.objectWithoutProperties(_ref,["err","loading"]);if(!verifyAction(type,action))return state;var resultState=state?state.result:null,createdState=state?state.created:null,lastUpdatedState=state?state.lastUpdated:null,newState=loading||null!==err?null:reducer(resultState,action);return{loading:loading,created:createdState||new Date,lastUpdated:lastUpdatedState&&newState===resultState?lastUpdatedState:new Date,error:err,result:newState}}},target=function(){var _ref=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},_ref$type=_ref.type,type=void 0===_ref$type?"":_ref$type,_ref$progress=_ref.progress,progress=void 0!==_ref$progress&&_ref$progress,reducer=arguments.length>1&&void 0!==arguments[1]?arguments[1]:noopReducer,initialState=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return function(){var state=arguments.length>0&&void 0!==arguments[0]?arguments[0]:initialState,action=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return verifyAction(type,action)&&action.target?babelHelpers.extends({},state,babelHelpers.defineProperty({},action.target,progress?progressReducer(type,reducer)(state,action):reducer(state,action))):state}},typeActions=function(type){var upperType=type.toUpperCase().replace(/\s/g,"");return{actionLoad:upperType+"/LOAD",actionLoadMore:upperType+"/LOAD_MORE",actionClear:upperType+"/CLEAR"}},handleState=function(state,action,_ref,_ref2){var actionLoad=_ref.actionLoad,actionLoadMore=_ref.actionLoadMore,actionClear=_ref.actionClear,dataType=_ref2.dataType;return action.type===actionLoad?action.data:action.type===actionLoadMore?"list"===dataType?[].concat(babelHelpers.toConsumableArray(state),babelHelpers.toConsumableArray(action.data)):action.data:action.type===actionClear?"list"===dataType?[]:null:state},reducer=function(_ref3,initialState){var type=_ref3.type,dataType=_ref3.dataType;return function(){var state=arguments.length>0&&void 0!==arguments[0]?arguments[0]:initialState,action=arguments[1];return handleState(void 0!==state?state:"list"===dataType?[]:null,action,typeActions(type),{type:type,dataType:dataType})}},basicTypeReducer=function(){var _ref4=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},_ref4$type=_ref4.type,type=void 0===_ref4$type?"BASIC_DEFAULT":_ref4$type,_ref4$progress=_ref4.progress,progress=void 0!==_ref4$progress&&_ref4$progress,_ref4$dataType=_ref4.dataType,dataType=void 0===_ref4$dataType?"single":_ref4$dataType,initialState=arguments[1],wrappedReducer=reducer({type:type,dataType:dataType},initialState);return progress&&(wrappedReducer=progressReducer(type,wrappedReducer)),wrappedReducer};exports.progressReducer=progressReducer,exports.targetReducer=target,exports.basicTypeReducer=basicTypeReducer; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var verifyAction=function(type,action){return!!(type&&action&&action.type)&&(type="/"!==type.slice(-1)?type+"/":type,0===action.type.indexOf(type))},noopReducer=function(state){return state},defineProperty=function(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj},_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},objectWithoutProperties=function(obj,keys){var target={};for(var i in obj)keys.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(obj,i)&&(target[i]=obj[i]);return target},toConsumableArray=function(arr){if(Array.isArray(arr)){for(var i=0,arr2=Array(arr.length);i<arr.length;i++)arr2[i]=arr[i];return arr2}return Array.from(arr)},progressReducer=function(){var type=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",reducer=arguments.length>1&&void 0!==arguments[1]?arguments[1]:noopReducer;return function(){var state=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{loading:!1,created:null,lastUpdated:null,error:null,result:null},_ref=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},_ref$err=_ref.err,err=void 0===_ref$err?null:_ref$err,_ref$loading=_ref.loading,loading=void 0!==_ref$loading&&_ref$loading,action=objectWithoutProperties(_ref,["err","loading"]);if(!verifyAction(type,action))return state;var resultState=state?state.result:null,createdState=state?state.created:null,lastUpdatedState=state?state.lastUpdated:null,newState=loading||null!==err?null:reducer(resultState,action);return{loading:loading,created:createdState||new Date,lastUpdated:lastUpdatedState&&newState===resultState?lastUpdatedState:new Date,error:err,result:newState}}},target=function(){var _ref=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},_ref$type=_ref.type,type=void 0===_ref$type?"":_ref$type,_ref$progress=_ref.progress,progress=void 0!==_ref$progress&&_ref$progress,reducer=arguments.length>1&&void 0!==arguments[1]?arguments[1]:noopReducer,initialState=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return function(){var state=arguments.length>0&&void 0!==arguments[0]?arguments[0]:initialState,action=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return verifyAction(type,action)&&action.target?_extends({},state,defineProperty({},action.target,progress?progressReducer(type,reducer)(state,action):reducer(state,action))):state}},typeActions=function(type){var upperType=type.toUpperCase().replace(/\s/g,"");return{actionLoad:upperType+"/LOAD",actionLoadMore:upperType+"/LOAD_MORE",actionClear:upperType+"/CLEAR"}},handleState=function(state,action,_ref,_ref2){var actionLoad=_ref.actionLoad,actionLoadMore=_ref.actionLoadMore,actionClear=_ref.actionClear,dataType=_ref2.dataType;return action.type===actionLoad?action.data:action.type===actionLoadMore?"list"===dataType?[].concat(toConsumableArray(state),toConsumableArray(action.data)):action.data:action.type===actionClear?"list"===dataType?[]:null:state},reducer=function(_ref3,initialState){var type=_ref3.type,dataType=_ref3.dataType;return function(){var state=arguments.length>0&&void 0!==arguments[0]?arguments[0]:initialState,action=arguments[1];return handleState(void 0!==state?state:"list"===dataType?[]:null,action,typeActions(type),{type:type,dataType:dataType})}},basicTypeReducer=function(){var _ref4=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},_ref4$type=_ref4.type,type=void 0===_ref4$type?"BASIC_DEFAULT":_ref4$type,_ref4$progress=_ref4.progress,progress=void 0!==_ref4$progress&&_ref4$progress,_ref4$dataType=_ref4.dataType,dataType=void 0===_ref4$dataType?"single":_ref4$dataType,initialState=arguments[1],wrappedReducer=reducer({type:type,dataType:dataType},initialState);return progress&&(wrappedReducer=progressReducer(type,wrappedReducer)),wrappedReducer};exports.progressReducer=progressReducer,exports.targetReducer=target,exports.basicTypeReducer=basicTypeReducer; | ||
//# sourceMappingURL=acpaas-ui-js-redux-utils.cjs.js.map |
@@ -1,2 +0,2 @@ | ||
var verifyAction=function(type,action){return!!(type&&action&&action.type)&&(type="/"!==type.slice(-1)?type+"/":type,0===action.type.indexOf(type))},noopReducer=function(state){return state},progressReducer=function(){var type=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",reducer=arguments.length>1&&void 0!==arguments[1]?arguments[1]:noopReducer;return function(){var state=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{loading:!1,created:null,lastUpdated:null,error:null,result:null},_ref=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},_ref$err=_ref.err,err=void 0===_ref$err?null:_ref$err,_ref$loading=_ref.loading,loading=void 0!==_ref$loading&&_ref$loading,action=babelHelpers.objectWithoutProperties(_ref,["err","loading"]);if(!verifyAction(type,action))return state;var resultState=state?state.result:null,createdState=state?state.created:null,lastUpdatedState=state?state.lastUpdated:null,newState=loading||null!==err?null:reducer(resultState,action);return{loading:loading,created:createdState||new Date,lastUpdated:lastUpdatedState&&newState===resultState?lastUpdatedState:new Date,error:err,result:newState}}},target=function(){var _ref=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},_ref$type=_ref.type,type=void 0===_ref$type?"":_ref$type,_ref$progress=_ref.progress,progress=void 0!==_ref$progress&&_ref$progress,reducer=arguments.length>1&&void 0!==arguments[1]?arguments[1]:noopReducer,initialState=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return function(){var state=arguments.length>0&&void 0!==arguments[0]?arguments[0]:initialState,action=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return verifyAction(type,action)&&action.target?babelHelpers.extends({},state,babelHelpers.defineProperty({},action.target,progress?progressReducer(type,reducer)(state,action):reducer(state,action))):state}},typeActions=function(type){var upperType=type.toUpperCase().replace(/\s/g,"");return{actionLoad:upperType+"/LOAD",actionLoadMore:upperType+"/LOAD_MORE",actionClear:upperType+"/CLEAR"}},handleState=function(state,action,_ref,_ref2){var actionLoad=_ref.actionLoad,actionLoadMore=_ref.actionLoadMore,actionClear=_ref.actionClear,dataType=_ref2.dataType;return action.type===actionLoad?action.data:action.type===actionLoadMore?"list"===dataType?[].concat(babelHelpers.toConsumableArray(state),babelHelpers.toConsumableArray(action.data)):action.data:action.type===actionClear?"list"===dataType?[]:null:state},reducer=function(_ref3,initialState){var type=_ref3.type,dataType=_ref3.dataType;return function(){var state=arguments.length>0&&void 0!==arguments[0]?arguments[0]:initialState,action=arguments[1];return handleState(void 0!==state?state:"list"===dataType?[]:null,action,typeActions(type),{type:type,dataType:dataType})}},basicTypeReducer=function(){var _ref4=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},_ref4$type=_ref4.type,type=void 0===_ref4$type?"BASIC_DEFAULT":_ref4$type,_ref4$progress=_ref4.progress,progress=void 0!==_ref4$progress&&_ref4$progress,_ref4$dataType=_ref4.dataType,dataType=void 0===_ref4$dataType?"single":_ref4$dataType,initialState=arguments[1],wrappedReducer=reducer({type:type,dataType:dataType},initialState);return progress&&(wrappedReducer=progressReducer(type,wrappedReducer)),wrappedReducer};export{progressReducer,target as targetReducer,basicTypeReducer}; | ||
var verifyAction=function(type,action){return!!(type&&action&&action.type)&&(type="/"!==type.slice(-1)?type+"/":type,0===action.type.indexOf(type))},noopReducer=function(state){return state},defineProperty=function(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj},_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},objectWithoutProperties=function(obj,keys){var target={};for(var i in obj)keys.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(obj,i)&&(target[i]=obj[i]);return target},toConsumableArray=function(arr){if(Array.isArray(arr)){for(var i=0,arr2=Array(arr.length);i<arr.length;i++)arr2[i]=arr[i];return arr2}return Array.from(arr)},progressReducer=function(){var type=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",reducer=arguments.length>1&&void 0!==arguments[1]?arguments[1]:noopReducer;return function(){var state=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{loading:!1,created:null,lastUpdated:null,error:null,result:null},_ref=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},_ref$err=_ref.err,err=void 0===_ref$err?null:_ref$err,_ref$loading=_ref.loading,loading=void 0!==_ref$loading&&_ref$loading,action=objectWithoutProperties(_ref,["err","loading"]);if(!verifyAction(type,action))return state;var resultState=state?state.result:null,createdState=state?state.created:null,lastUpdatedState=state?state.lastUpdated:null,newState=loading||null!==err?null:reducer(resultState,action);return{loading:loading,created:createdState||new Date,lastUpdated:lastUpdatedState&&newState===resultState?lastUpdatedState:new Date,error:err,result:newState}}},target=function(){var _ref=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},_ref$type=_ref.type,type=void 0===_ref$type?"":_ref$type,_ref$progress=_ref.progress,progress=void 0!==_ref$progress&&_ref$progress,reducer=arguments.length>1&&void 0!==arguments[1]?arguments[1]:noopReducer,initialState=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return function(){var state=arguments.length>0&&void 0!==arguments[0]?arguments[0]:initialState,action=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return verifyAction(type,action)&&action.target?_extends({},state,defineProperty({},action.target,progress?progressReducer(type,reducer)(state,action):reducer(state,action))):state}},typeActions=function(type){var upperType=type.toUpperCase().replace(/\s/g,"");return{actionLoad:upperType+"/LOAD",actionLoadMore:upperType+"/LOAD_MORE",actionClear:upperType+"/CLEAR"}},handleState=function(state,action,_ref,_ref2){var actionLoad=_ref.actionLoad,actionLoadMore=_ref.actionLoadMore,actionClear=_ref.actionClear,dataType=_ref2.dataType;return action.type===actionLoad?action.data:action.type===actionLoadMore?"list"===dataType?[].concat(toConsumableArray(state),toConsumableArray(action.data)):action.data:action.type===actionClear?"list"===dataType?[]:null:state},reducer=function(_ref3,initialState){var type=_ref3.type,dataType=_ref3.dataType;return function(){var state=arguments.length>0&&void 0!==arguments[0]?arguments[0]:initialState,action=arguments[1];return handleState(void 0!==state?state:"list"===dataType?[]:null,action,typeActions(type),{type:type,dataType:dataType})}},basicTypeReducer=function(){var _ref4=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},_ref4$type=_ref4.type,type=void 0===_ref4$type?"BASIC_DEFAULT":_ref4$type,_ref4$progress=_ref4.progress,progress=void 0!==_ref4$progress&&_ref4$progress,_ref4$dataType=_ref4.dataType,dataType=void 0===_ref4$dataType?"single":_ref4$dataType,initialState=arguments[1],wrappedReducer=reducer({type:type,dataType:dataType},initialState);return progress&&(wrappedReducer=progressReducer(type,wrappedReducer)),wrappedReducer};export{progressReducer,target as targetReducer,basicTypeReducer}; | ||
//# sourceMappingURL=acpaas-ui-js-redux-utils.es.js.map |
@@ -1,2 +0,2 @@ | ||
!function(global,factory){"object"==typeof exports&&"undefined"!=typeof module?factory(exports):"function"==typeof define&&define.amd?define(["exports"],factory):factory(global["@acpaas-ui/js-redux-utils"]=global["@acpaas-ui/js-redux-utils"]||{})}(this,function(exports){"use strict";var verifyAction=function(type,action){return!!(type&&action&&action.type)&&(type="/"!==type.slice(-1)?type+"/":type,0===action.type.indexOf(type))},noopReducer=function(state){return state},progressReducer=function(){var type=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",reducer=arguments.length>1&&void 0!==arguments[1]?arguments[1]:noopReducer;return function(){var state=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{loading:!1,created:null,lastUpdated:null,error:null,result:null},_ref=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},_ref$err=_ref.err,err=void 0===_ref$err?null:_ref$err,_ref$loading=_ref.loading,loading=void 0!==_ref$loading&&_ref$loading,action=babelHelpers.objectWithoutProperties(_ref,["err","loading"]);if(!verifyAction(type,action))return state;var resultState=state?state.result:null,createdState=state?state.created:null,lastUpdatedState=state?state.lastUpdated:null,newState=loading||null!==err?null:reducer(resultState,action);return{loading:loading,created:createdState||new Date,lastUpdated:lastUpdatedState&&newState===resultState?lastUpdatedState:new Date,error:err,result:newState}}},reducer=function(_ref3,initialState){var type=_ref3.type,dataType=_ref3.dataType;return function(){var state=arguments.length>0&&void 0!==arguments[0]?arguments[0]:initialState,action=arguments[1];return function(state,action,_ref,_ref2){var actionLoad=_ref.actionLoad,actionLoadMore=_ref.actionLoadMore,actionClear=_ref.actionClear,dataType=_ref2.dataType;return action.type===actionLoad?action.data:action.type===actionLoadMore?"list"===dataType?[].concat(babelHelpers.toConsumableArray(state),babelHelpers.toConsumableArray(action.data)):action.data:action.type===actionClear?"list"===dataType?[]:null:state}(void 0!==state?state:"list"===dataType?[]:null,action,function(type){var upperType=type.toUpperCase().replace(/\s/g,"");return{actionLoad:upperType+"/LOAD",actionLoadMore:upperType+"/LOAD_MORE",actionClear:upperType+"/CLEAR"}}(type),{type:type,dataType:dataType})}};exports.progressReducer=progressReducer,exports.targetReducer=function(){var _ref=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},_ref$type=_ref.type,type=void 0===_ref$type?"":_ref$type,_ref$progress=_ref.progress,progress=void 0!==_ref$progress&&_ref$progress,reducer=arguments.length>1&&void 0!==arguments[1]?arguments[1]:noopReducer,initialState=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return function(){var state=arguments.length>0&&void 0!==arguments[0]?arguments[0]:initialState,action=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return verifyAction(type,action)&&action.target?babelHelpers.extends({},state,babelHelpers.defineProperty({},action.target,progress?progressReducer(type,reducer)(state,action):reducer(state,action))):state}},exports.basicTypeReducer=function(){var _ref4=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},_ref4$type=_ref4.type,type=void 0===_ref4$type?"BASIC_DEFAULT":_ref4$type,_ref4$progress=_ref4.progress,progress=void 0!==_ref4$progress&&_ref4$progress,_ref4$dataType=_ref4.dataType,dataType=void 0===_ref4$dataType?"single":_ref4$dataType,initialState=arguments[1],wrappedReducer=reducer({type:type,dataType:dataType},initialState);return progress&&(wrappedReducer=progressReducer(type,wrappedReducer)),wrappedReducer},Object.defineProperty(exports,"__esModule",{value:!0})}); | ||
!function(global,factory){"object"==typeof exports&&"undefined"!=typeof module?factory(exports):"function"==typeof define&&define.amd?define(["exports"],factory):factory(global["@acpaas-ui/js-redux-utils"]=global["@acpaas-ui/js-redux-utils"]||{})}(this,function(exports){"use strict";var verifyAction=function(type,action){return!!(type&&action&&action.type)&&(type="/"!==type.slice(-1)?type+"/":type,0===action.type.indexOf(type))},noopReducer=function(state){return state},_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},toConsumableArray=function(arr){if(Array.isArray(arr)){for(var i=0,arr2=Array(arr.length);i<arr.length;i++)arr2[i]=arr[i];return arr2}return Array.from(arr)},progressReducer=function(){var type=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",reducer=arguments.length>1&&void 0!==arguments[1]?arguments[1]:noopReducer;return function(){var state=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{loading:!1,created:null,lastUpdated:null,error:null,result:null},_ref=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},_ref$err=_ref.err,err=void 0===_ref$err?null:_ref$err,_ref$loading=_ref.loading,loading=void 0!==_ref$loading&&_ref$loading,action=function(obj,keys){var target={};for(var i in obj)keys.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(obj,i)&&(target[i]=obj[i]);return target}(_ref,["err","loading"]);if(!verifyAction(type,action))return state;var resultState=state?state.result:null,createdState=state?state.created:null,lastUpdatedState=state?state.lastUpdated:null,newState=loading||null!==err?null:reducer(resultState,action);return{loading:loading,created:createdState||new Date,lastUpdated:lastUpdatedState&&newState===resultState?lastUpdatedState:new Date,error:err,result:newState}}},reducer=function(_ref3,initialState){var type=_ref3.type,dataType=_ref3.dataType;return function(){var state=arguments.length>0&&void 0!==arguments[0]?arguments[0]:initialState,action=arguments[1];return function(state,action,_ref,_ref2){var actionLoad=_ref.actionLoad,actionLoadMore=_ref.actionLoadMore,actionClear=_ref.actionClear,dataType=_ref2.dataType;return action.type===actionLoad?action.data:action.type===actionLoadMore?"list"===dataType?[].concat(toConsumableArray(state),toConsumableArray(action.data)):action.data:action.type===actionClear?"list"===dataType?[]:null:state}(void 0!==state?state:"list"===dataType?[]:null,action,function(type){var upperType=type.toUpperCase().replace(/\s/g,"");return{actionLoad:upperType+"/LOAD",actionLoadMore:upperType+"/LOAD_MORE",actionClear:upperType+"/CLEAR"}}(type),{type:type,dataType:dataType})}};exports.progressReducer=progressReducer,exports.targetReducer=function(){var _ref=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},_ref$type=_ref.type,type=void 0===_ref$type?"":_ref$type,_ref$progress=_ref.progress,progress=void 0!==_ref$progress&&_ref$progress,reducer=arguments.length>1&&void 0!==arguments[1]?arguments[1]:noopReducer,initialState=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return function(){var obj,key,value,state=arguments.length>0&&void 0!==arguments[0]?arguments[0]:initialState,action=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return verifyAction(type,action)&&action.target?_extends({},state,(obj={},key=action.target,value=progress?progressReducer(type,reducer)(state,action):reducer(state,action),key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj)):state}},exports.basicTypeReducer=function(){var _ref4=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},_ref4$type=_ref4.type,type=void 0===_ref4$type?"BASIC_DEFAULT":_ref4$type,_ref4$progress=_ref4.progress,progress=void 0!==_ref4$progress&&_ref4$progress,_ref4$dataType=_ref4.dataType,dataType=void 0===_ref4$dataType?"single":_ref4$dataType,initialState=arguments[1],wrappedReducer=reducer({type:type,dataType:dataType},initialState);return progress&&(wrappedReducer=progressReducer(type,wrappedReducer)),wrappedReducer},Object.defineProperty(exports,"__esModule",{value:!0})}); | ||
//# sourceMappingURL=acpaas-ui-js-redux-utils.umd.js.map |
{ | ||
"name": "@acpaas-ui/js-redux-utils", | ||
"version": "1.0.1-alpha.2", | ||
"version": "1.0.1-alpha.3", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "js-redux-utils.umd.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
44024
89