react-hot-api
Advanced tools
Comparing version 0.1.2 to 0.1.3
@@ -5,24 +5,26 @@ var deepForceUpdate = require('./deepForceUpdate'); | ||
/** | ||
* Forces deep re-render of all mounted React components. | ||
* Hat's off to Omar Skalli (@Chetane) for suggesting this approach: | ||
* https://gist.github.com/Chetane/9a230a9fdcdca21a4e29 | ||
*/ | ||
function forceUpdateAll(ReactMount) { | ||
isRequestPending = false; | ||
module.exports = function requestForceUpdateAll(ReactMount) { | ||
if (isRequestPending) { | ||
return; | ||
} | ||
var rootInstances = ReactMount._instancesByReactRootID || ReactMount._instancesByContainerID, | ||
rootInstance; | ||
/** | ||
* Forces deep re-render of all mounted React components. | ||
* Hat's off to Omar Skalli (@Chetane) for suggesting this approach: | ||
* https://gist.github.com/Chetane/9a230a9fdcdca21a4e29 | ||
*/ | ||
function forceUpdateAll() { | ||
isRequestPending = false; | ||
for (var key in rootInstances) { | ||
if (rootInstances.hasOwnProperty(key)) { | ||
deepForceUpdate(rootInstances[key]); | ||
var rootInstances = ReactMount._instancesByReactRootID || ReactMount._instancesByContainerID, | ||
rootInstance; | ||
for (var key in rootInstances) { | ||
if (rootInstances.hasOwnProperty(key)) { | ||
deepForceUpdate(rootInstances[key]); | ||
} | ||
} | ||
} | ||
} | ||
module.exports = function requestForceUpdateAll() { | ||
if (!isRequestPending) { | ||
setTimeout(forceUpdateAll, 0); | ||
} | ||
setTimeout(forceUpdateAll); | ||
}; |
{ | ||
"name": "react-hot-api", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "A generic library implementing hot reload for React components without unmounting or losing their state.", | ||
@@ -5,0 +5,0 @@ "main": "modules/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
11560
140