New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

use-sync-external-store

Package Overview
Dependencies
Maintainers
1
Versions
1551
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

use-sync-external-store - npm Package Compare versions

Comparing version 0.0.0-experimental-1314299c7-20210901 to 0.0.0-experimental-33226fada-20210913

16

cjs/use-sync-external-store.development.js

@@ -78,3 +78,4 @@ /** @license React vundefined

var useSyncExternalStore = builtInAPI !== undefined ? builtInAPI : useSyncExternalStore_shim;
var didWarnOld18Alpha = false; // Disclaimer: This shim breaks many of the rules of React, and only works
var didWarnOld18Alpha = false;
var didWarnUncachedGetSnapshot = false; // Disclaimer: This shim breaks many of the rules of React, and only works
// because of a very particular set of implementation details and assumptions

@@ -105,3 +106,13 @@ // -- change any one of them and it will break. The most important assumption

var value = getSnapshot(); // Because updates are synchronous, we don't queue them. Instead we force a
var value = getSnapshot();
{
if (!didWarnUncachedGetSnapshot) {
if (value !== getSnapshot()) {
error('The result of getSnapshot should be cached to avoid an infinite loop');
didWarnUncachedGetSnapshot = true;
}
}
} // Because updates are synchronous, we don't queue them. Instead we force a
// re-render whenever the subscribed state changes by updating an some

@@ -121,2 +132,3 @@ // arbitrary useState hook. Then, during render, we call getSnapshot to read

var _useState = useState({

@@ -123,0 +135,0 @@ inst: {

4

package.json
{
"name": "use-sync-external-store",
"description": "Backwards compatible shim for React's useSyncExternalStore. Works with any React that supports hooks.",
"version": "0.0.0-experimental-1314299c7-20210901",
"version": "0.0.0-experimental-33226fada-20210913",
"repository": {

@@ -20,4 +20,4 @@ "type": "git",

"peerDependencies": {
"react": "0.0.0-experimental-1314299c7-20210901"
"react": "0.0.0-experimental-33226fada-20210913"
}
}
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