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.1 to 0.1.2

4

modules/makeMakeHot.js

@@ -9,3 +9,3 @@ 'use strict';

*/
module.exports = function makeMakeHot() {
module.exports = function makeMakeHot(ReactMount) {
var patchers = {};

@@ -26,3 +26,3 @@

if (!patchers[persistentId]) {
patchers[persistentId] = makePatchReactClass();
patchers[persistentId] = makePatchReactClass(ReactMount);
}

@@ -29,0 +29,0 @@

@@ -10,3 +10,3 @@ 'use strict';

*/
module.exports = function makePatchReactClass() {
module.exports = function makePatchReactClass(ReactMount) {
var assimilatePrototype = makeAssimilatePrototype(),

@@ -26,6 +26,9 @@ FirstClass = null;

assimilatePrototype(nextPrototype);
requestForceUpdateAll();
if (FirstClass) {
requestForceUpdateAll(ReactMount);
}
return FirstClass || (FirstClass = NextClass);
};
};

@@ -1,3 +0,2 @@

var ReactMount = require('react/lib/ReactMount'),
deepForceUpdate = require('./deepForceUpdate');
var deepForceUpdate = require('./deepForceUpdate');

@@ -11,3 +10,3 @@ var isRequestPending = false;

*/
function forceUpdateAll() {
function forceUpdateAll(ReactMount) {
isRequestPending = false;

@@ -14,0 +13,0 @@

{
"name": "react-hot-api",
"version": "0.1.1",
"version": "0.1.2",
"description": "A generic library implementing hot reload for React components without unmounting or losing their state.",

@@ -5,0 +5,0 @@ "main": "modules/index.js",

@@ -18,3 +18,3 @@ react-hot-api

#### `require('react-hot-api'): () => makeHot`
#### `require('react-hot-api'): (ReactMount) => makeHot`

@@ -24,2 +24,4 @@ Invoke this once within each hot-reloadable module to obtain the function described above.

`ReactMount` corresponds to `react/lib/ReactMount` and needs to be passed by the caller.
### Usage

@@ -60,3 +62,3 @@

// On the first run, we will get here
makeHot = SOME_STORAGE_SHARED_BETWEEN_VERSIONS_OF_SAME_MODULE.makeHot = require('react-hot-api')();
makeHot = SOME_STORAGE_SHARED_BETWEEN_VERSIONS_OF_SAME_MODULE.makeHot = require('react-hot-api')(require('react/lib/ReactMount'));
}

@@ -89,3 +91,3 @@

// On the second run, we will *NOT* get here
makeHot = SOME_STORAGE_SHARED_BETWEEN_VERSIONS_OF_SAME_MODULE.makeHot = require('react-hot-api')();
makeHot = SOME_STORAGE_SHARED_BETWEEN_VERSIONS_OF_SAME_MODULE.makeHot = require('react-hot-api')(require('react/lib/ReactMount'));
}

@@ -105,3 +107,3 @@

// put the function into some sane place (e.g. module.makeHot) without relying on hidden variables
module.makeHot = SOME_STORAGE_SHARED_BETWEEN_VERSIONS_OF_SAME_MODULE.makeHot = require('react-hot-api')();
module.makeHot = SOME_STORAGE_SHARED_BETWEEN_VERSIONS_OF_SAME_MODULE.makeHot = require('react-hot-api')(require('react/lib/ReactMount'));
}

@@ -108,0 +110,0 @@ // You might generate the code above with your build tool

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