Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-hot-api

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-hot-api - npm Package Compare versions

Comparing version 0.1.2 to 0.1.3

36

modules/requestForceUpdateAll.js

@@ -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",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc