Comparing version 1.0.0 to 2.0.0
@@ -9,3 +9,2 @@ module.exports = { | ||
createChainedFunction: require('./lib/createChainedFunction'), | ||
cloneWithProps: require('./lib/cloneWithProps'), | ||
Dom: { | ||
@@ -12,0 +11,0 @@ addEventListener: require('./lib/Dom/addEventListener'), |
@@ -7,20 +7,16 @@ /** | ||
* | ||
* @param {function} one | ||
* @param {function} two | ||
* @returns {function|null} | ||
*/ | ||
function createChainedFunction(one, two) { | ||
var hasOne = typeof one === 'function'; | ||
var hasTwo = typeof two === 'function'; | ||
function createChainedFunction() { | ||
var args = arguments; | ||
if (!hasOne && !hasTwo) { return null; } | ||
if (!hasOne) { return two; } | ||
if (!hasTwo) { return one; } | ||
return function chainedFunction() { | ||
one.apply(this, arguments); | ||
two.apply(this, arguments); | ||
for (var i = 0; i < args.length; i++) { | ||
if (args[i]) { | ||
args[i].apply(this, arguments); | ||
} | ||
} | ||
}; | ||
} | ||
module.exports = createChainedFunction; | ||
module.exports = createChainedFunction; |
{ | ||
"name": "rc-util", | ||
"version": "1.0.0", | ||
"version": "2.0.0", | ||
"description": "Common Utils For React Component", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -59,6 +59,2 @@ # rc-util | ||
### cloneWithProps:function | ||
http://facebook.github.io/react/docs/clone-with-props.html | ||
### Dom.addEventListener:function | ||
@@ -65,0 +61,0 @@ |
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
19005
20
704
73