Socket
Socket
Sign inDemoInstall

use-sync-external-store

Package Overview
Dependencies
1
Maintainers
3
Versions
1195
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.0-experimental-4bf2113a1-20230206 to 0.0.0-experimental-4c12339ce-20240408

cjs/use-sync-external-store-shim.native.production.js

8

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

@@ -97,3 +97,3 @@ /**

function useSyncExternalStore(subscribe, getSnapshot, // Note: The shim does not use getServerSnapshot, because pre-18 versions of
function useSyncExternalStore$2(subscribe, getSnapshot, // Note: The shim does not use getServerSnapshot, because pre-18 versions of
// React do not expose a way to check if we're hydrating. So users of the shim

@@ -227,6 +227,6 @@ // will need to track that themselves and return the correct value

var shim = isServerEnvironment ? useSyncExternalStore$1 : useSyncExternalStore;
var useSyncExternalStore$2 = React.useSyncExternalStore !== undefined ? React.useSyncExternalStore : shim;
var shim = isServerEnvironment ? useSyncExternalStore$1 : useSyncExternalStore$2;
var useSyncExternalStore = React.useSyncExternalStore !== undefined ? React.useSyncExternalStore : shim;
exports.useSyncExternalStore = useSyncExternalStore$2;
exports.useSyncExternalStore = useSyncExternalStore;
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */

@@ -233,0 +233,0 @@ if (

@@ -97,3 +97,3 @@ /**

function useSyncExternalStore(subscribe, getSnapshot, // Note: The shim does not use getServerSnapshot, because pre-18 versions of
function useSyncExternalStore$1(subscribe, getSnapshot, // Note: The shim does not use getServerSnapshot, because pre-18 versions of
// React do not expose a way to check if we're hydrating. So users of the shim

@@ -215,6 +215,6 @@ // will need to track that themselves and return the correct value

var shim = useSyncExternalStore;
var useSyncExternalStore$1 = React.useSyncExternalStore !== undefined ? React.useSyncExternalStore : shim;
var shim = useSyncExternalStore$1;
var useSyncExternalStore = React.useSyncExternalStore !== undefined ? React.useSyncExternalStore : shim;
exports.useSyncExternalStore = useSyncExternalStore$1;
exports.useSyncExternalStore = useSyncExternalStore;
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */

@@ -221,0 +221,0 @@ if (

@@ -1,11 +0,13 @@

/**
* @license React
* use-sync-external-store-shim.native.production.min.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/*
React
use-sync-external-store-shim.native.production.min.js
Copyright (c) Meta Platforms, Inc. and affiliates.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
*/
'use strict';var e=require("react");function h(a,b){return a===b&&(0!==a||1/a===1/b)||a!==a&&b!==b}var k="function"===typeof Object.is?Object.is:h,l=e.useState,m=e.useEffect,n=e.useLayoutEffect,p=e.useDebugValue;function q(a,b){var d=b(),f=l({inst:{value:d,getSnapshot:b}}),c=f[0].inst,g=f[1];n(function(){c.value=d;c.getSnapshot=b;r(c)&&g({inst:c})},[a,d,b]);m(function(){r(c)&&g({inst:c});return a(function(){r(c)&&g({inst:c})})},[a]);p(d);return d}
function r(a){var b=a.getSnapshot;a=a.value;try{var d=b();return!k(a,d)}catch(f){return!0}}exports.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:q;
//# sourceMappingURL=use-sync-external-store-shim.native.production.min.js.map

@@ -1,11 +0,13 @@

/**
* @license React
* use-sync-external-store-shim.production.min.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/*
React
use-sync-external-store-shim.production.min.js
Copyright (c) Meta Platforms, Inc. and affiliates.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
*/
'use strict';var e=require("react");function h(a,b){return a===b&&(0!==a||1/a===1/b)||a!==a&&b!==b}var k="function"===typeof Object.is?Object.is:h,l=e.useState,m=e.useEffect,n=e.useLayoutEffect,p=e.useDebugValue;function q(a,b){var d=b(),f=l({inst:{value:d,getSnapshot:b}}),c=f[0].inst,g=f[1];n(function(){c.value=d;c.getSnapshot=b;r(c)&&g({inst:c})},[a,d,b]);m(function(){r(c)&&g({inst:c});return a(function(){r(c)&&g({inst:c})})},[a]);p(d);return d}
function r(a){var b=a.getSnapshot;a=a.value;try{var d=b();return!k(a,d)}catch(f){return!0}}function t(a,b){return b()}var u="undefined"===typeof window||"undefined"===typeof window.document||"undefined"===typeof window.document.createElement?t:q;exports.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:u;
//# sourceMappingURL=use-sync-external-store-shim.production.min.js.map

@@ -148,3 +148,5 @@ /**

useEffect(function () {
inst.hasValue = true;
// $FlowFixMe[incompatible-type] changing the variant using mutation isn't supported
inst.hasValue = true; // $FlowFixMe[incompatible-type]
inst.value = value;

@@ -151,0 +153,0 @@ }, [value]);

@@ -1,12 +0,14 @@

/**
* @license React
* use-sync-external-store-shim/with-selector.production.min.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
'use strict';var h=require("react"),n=require("use-sync-external-store/shim");function p(a,b){return a===b&&(0!==a||1/a===1/b)||a!==a&&b!==b}var q="function"===typeof Object.is?Object.is:p,r=n.useSyncExternalStore,t=h.useRef,u=h.useEffect,v=h.useMemo,w=h.useDebugValue;
exports.useSyncExternalStoreWithSelector=function(a,b,e,l,g){var c=t(null);if(null===c.current){var f={hasValue:!1,value:null};c.current=f}else f=c.current;c=v(function(){function a(a){if(!c){c=!0;d=a;a=l(a);if(void 0!==g&&f.hasValue){var b=f.value;if(g(b,a))return k=b}return k=a}b=k;if(q(d,a))return b;var e=l(a);if(void 0!==g&&g(b,e))return b;d=a;return k=e}var c=!1,d,k,m=void 0===e?null:e;return[function(){return a(b())},null===m?void 0:function(){return a(m())}]},[b,e,l,g]);var d=r(a,c[0],c[1]);
u(function(){f.hasValue=!0;f.value=d},[d]);w(d);return d};
/*
React
use-sync-external-store-shim/with-selector.production.min.js
Copyright (c) Meta Platforms, Inc. and affiliates.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
*/
'use strict';var h=require("react"),v=require("use-sync-external-store/shim");function w(b,c){return b===c&&(0!==b||1/b===1/c)||b!==b&&c!==c}var x="function"===typeof Object.is?Object.is:w,y=v.useSyncExternalStore,z=h.useRef,A=h.useEffect,B=h.useMemo,C=h.useDebugValue;
exports.useSyncExternalStoreWithSelector=function(b,c,m,n,g){var d=z(null);if(null===d.current){var e={hasValue:!1,value:null};d.current=e}else e=d.current;d=B(function(){function q(a){if(!r){r=!0;p=a;a=n(a);if(void 0!==g&&e.hasValue){var f=e.value;if(g(f,a))return k=f}return k=a}f=k;if(x(p,a))return f;var t=n(a);if(void 0!==g&&g(f,t))return f;p=a;return k=t}var r=!1,p,k,u=void 0===m?null:m;return[function(){return q(c())},null===u?void 0:function(){return q(u())}]},[c,m,n,g]);var l=y(b,d[0],d[1]);
A(function(){e.hasValue=!0;e.value=l},[l]);C(l);return l};
//# sourceMappingURL=with-selector.production.min.js.map

@@ -147,3 +147,5 @@ /**

useEffect(function () {
inst.hasValue = true;
// $FlowFixMe[incompatible-type] changing the variant using mutation isn't supported
inst.hasValue = true; // $FlowFixMe[incompatible-type]
inst.value = value;

@@ -150,0 +152,0 @@ }, [value]);

@@ -1,12 +0,14 @@

/**
* @license React
* use-sync-external-store-with-selector.production.min.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
'use strict';var g=require("react");function n(a,b){return a===b&&(0!==a||1/a===1/b)||a!==a&&b!==b}var p="function"===typeof Object.is?Object.is:n,q=g.useSyncExternalStore,r=g.useRef,t=g.useEffect,u=g.useMemo,v=g.useDebugValue;
exports.useSyncExternalStoreWithSelector=function(a,b,e,l,h){var c=r(null);if(null===c.current){var f={hasValue:!1,value:null};c.current=f}else f=c.current;c=u(function(){function a(a){if(!c){c=!0;d=a;a=l(a);if(void 0!==h&&f.hasValue){var b=f.value;if(h(b,a))return k=b}return k=a}b=k;if(p(d,a))return b;var e=l(a);if(void 0!==h&&h(b,e))return b;d=a;return k=e}var c=!1,d,k,m=void 0===e?null:e;return[function(){return a(b())},null===m?void 0:function(){return a(m())}]},[b,e,l,h]);var d=q(a,c[0],c[1]);
t(function(){f.hasValue=!0;f.value=d},[d]);v(d);return d};
/*
React
use-sync-external-store-with-selector.production.min.js
Copyright (c) Meta Platforms, Inc. and affiliates.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
*/
'use strict';var g=require("react");function v(b,c){return b===c&&(0!==b||1/b===1/c)||b!==b&&c!==c}var w="function"===typeof Object.is?Object.is:v,x=g.useSyncExternalStore,y=g.useRef,z=g.useEffect,A=g.useMemo,B=g.useDebugValue;
exports.useSyncExternalStoreWithSelector=function(b,c,m,n,h){var d=y(null);if(null===d.current){var e={hasValue:!1,value:null};d.current=e}else e=d.current;d=A(function(){function q(a){if(!r){r=!0;p=a;a=n(a);if(void 0!==h&&e.hasValue){var f=e.value;if(h(f,a))return k=f}return k=a}f=k;if(w(p,a))return f;var t=n(a);if(void 0!==h&&h(f,t))return f;p=a;return k=t}var r=!1,p,k,u=void 0===m?null:m;return[function(){return q(c())},null===u?void 0:function(){return q(u())}]},[c,m,n,h]);var l=x(b,d[0],d[1]);
z(function(){e.hasValue=!0;e.value=l},[l]);B(l);return l};
//# sourceMappingURL=use-sync-external-store-with-selector.production.min.js.map

@@ -1,10 +0,12 @@

/**
* @license React
* use-sync-external-store.production.min.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/*
React
use-sync-external-store.production.min.js
Copyright (c) Meta Platforms, Inc. and affiliates.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
*/
'use strict';var a=require("react").useSyncExternalStore;exports.useSyncExternalStore=a;
//# sourceMappingURL=use-sync-external-store.production.min.js.map
{
"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-4bf2113a1-20230206",
"version": "0.0.0-experimental-4c12339ce-20240408",
"repository": {

@@ -22,4 +22,8 @@ "type": "git",

"peerDependencies": {
"react": "0.0.0-experimental-4bf2113a1-20230206"
"react": "0.0.0-experimental-4c12339ce-20240408"
},
"devDependencies": {
"react-17": "npm:react@^17",
"react-dom-17": "npm:react-dom@^17"
}
}
SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc