@appbaseio/reactivecore
Advanced tools
Comparing version 1.2.4 to 1.2.5
@@ -1,1 +0,1 @@ | ||
Object.defineProperty(exports,"__esModule",{value:true});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=watchManReducer;var _constants=require('../constants');function _toConsumableArray(arr){if(Array.isArray(arr)){for(var i=0,arr2=Array(arr.length);i<arr.length;i++){arr2[i]=arr[i];}return arr2;}else{return Array.from(arr);}}function getWatchList(depTree){var list=Object.values(depTree);var components=[];list.forEach(function(item){if(typeof item==='string'){components.push(item);}else if(Array.isArray(item)){components.push.apply(components,_toConsumableArray(item));}else if(typeof item==='object'&&item!==null){components.push.apply(components,_toConsumableArray(getWatchList(item)));}});return[].concat(_toConsumableArray(new Set(components)));}function watchManReducer(){var state=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var action=arguments[1];if(action.type===_constants.WATCH_COMPONENT){var watchList=getWatchList(action.react);var newState=_extends({},state);Object.keys(newState).forEach(function(key){newState[key]=newState[key].filter(function(value){return value!==action.component;});});watchList.forEach(function(item){if(Array.isArray(newState[item])){newState[item]=[].concat(_toConsumableArray(newState[item]),[action.component]);}else{newState[item]=[action.component];}});return newState;}else if(action.type===_constants.REMOVE_COMPONENT){var _newState=_extends({},state);Object.keys(_newState).forEach(function(component){if(component===action.component){delete _newState[component];}else{_newState[component]=_newState[component].filter(function(item){return item!==action.component;});}});return _newState;}return state;} | ||
Object.defineProperty(exports,"__esModule",{value:true});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=watchManReducer;var _constants=require('../constants');function _toConsumableArray(arr){if(Array.isArray(arr)){for(var i=0,arr2=Array(arr.length);i<arr.length;i++){arr2[i]=arr[i];}return arr2;}else{return Array.from(arr);}}function getWatchList(depTree){var list=Object.values(depTree);var components=[];list.forEach(function(item){if(typeof item==='string'){components.push(item);}else if(Array.isArray(item)){components.push.apply(components,_toConsumableArray(item));}else if(typeof item==='object'&&item!==null){components.push.apply(components,_toConsumableArray(getWatchList(item)));}});return components.filter(function(value,index,array){return array.indexOf(value)===index;});}function watchManReducer(){var state=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var action=arguments[1];if(action.type===_constants.WATCH_COMPONENT){var watchList=getWatchList(action.react);var newState=_extends({},state);Object.keys(newState).forEach(function(key){newState[key]=newState[key].filter(function(value){return value!==action.component;});});watchList.forEach(function(item){if(Array.isArray(newState[item])){newState[item]=[].concat(_toConsumableArray(newState[item]),[action.component]);}else{newState[item]=[action.component];}});return newState;}else if(action.type===_constants.REMOVE_COMPONENT){var _newState=_extends({},state);Object.keys(_newState).forEach(function(component){if(component===action.component){delete _newState[component];}else{_newState[component]=_newState[component].filter(function(item){return item!==action.component;});}});return _newState;}return state;} |
{ | ||
"name": "@appbaseio/reactivecore", | ||
"version": "1.2.4", | ||
"version": "1.2.5", | ||
"description": "Core architecture of reactive UI libraries", | ||
@@ -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
51148
24