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

react-freeze

Package Overview
Dependencies
Maintainers
2
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-freeze - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

2

dist/index.d.ts

@@ -7,3 +7,3 @@ import React from "react";

}
export declare function Freeze({ freeze, children, placeholder }: Props): JSX.Element;
export declare function Freeze({ freeze, children, placeholder }: Props): React.JSX.Element;
export {};

@@ -6,27 +6,18 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }

var infiniteThenable = {
then: function then() {}
};
function Suspender(_ref) {
var freeze = _ref.freeze,
children = _ref.children;
var promiseCache = React.useRef({}).current;
if (freeze && !promiseCache.promise) {
promiseCache.promise = new Promise(function (resolve) {
promiseCache.resolve = resolve;
});
throw promiseCache.promise;
} else if (freeze) {
throw promiseCache.promise;
} else if (promiseCache.promise) {
promiseCache.resolve();
promiseCache.promise = undefined;
children = _ref.children;
if (freeze) {
throw infiniteThenable;
}
return React__default.createElement(React.Fragment, null, children);
}
function Freeze(_ref2) {
var freeze = _ref2.freeze,
children = _ref2.children,
_ref2$placeholder = _ref2.placeholder,
placeholder = _ref2$placeholder === void 0 ? null : _ref2$placeholder;
children = _ref2.children,
_ref2$placeholder = _ref2.placeholder,
placeholder = _ref2$placeholder === void 0 ? null : _ref2$placeholder;
return React__default.createElement(React.Suspense, {

@@ -33,0 +24,0 @@ fallback: placeholder

@@ -1,28 +0,19 @@

import React, { Suspense, useRef, Fragment } from 'react';
import React, { Suspense, Fragment } from 'react';
var infiniteThenable = {
then: function then() {}
};
function Suspender(_ref) {
var freeze = _ref.freeze,
children = _ref.children;
var promiseCache = useRef({}).current;
if (freeze && !promiseCache.promise) {
promiseCache.promise = new Promise(function (resolve) {
promiseCache.resolve = resolve;
});
throw promiseCache.promise;
} else if (freeze) {
throw promiseCache.promise;
} else if (promiseCache.promise) {
promiseCache.resolve();
promiseCache.promise = undefined;
children = _ref.children;
if (freeze) {
throw infiniteThenable;
}
return React.createElement(Fragment, null, children);
}
function Freeze(_ref2) {
var freeze = _ref2.freeze,
children = _ref2.children,
_ref2$placeholder = _ref2.placeholder,
placeholder = _ref2$placeholder === void 0 ? null : _ref2$placeholder;
children = _ref2.children,
_ref2$placeholder = _ref2.placeholder,
placeholder = _ref2$placeholder === void 0 ? null : _ref2$placeholder;
return React.createElement(Suspense, {

@@ -29,0 +20,0 @@ fallback: placeholder

{
"name": "react-freeze",
"version": "1.0.3",
"version": "1.0.4",
"description": "React Freeze",

@@ -5,0 +5,0 @@ "license": "MIT",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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