-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathuse-sync-external-store@1.2.0.patch
180 lines (157 loc) · 10.6 KB
/
use-sync-external-store@1.2.0.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
diff --git a/cjs/use-sync-external-store-shim.development.js b/cjs/use-sync-external-store-shim.development.js
index c849ab8..348baaa 100644
--- a/cjs/use-sync-external-store-shim.development.js
+++ b/cjs/use-sync-external-store-shim.development.js
@@ -10,6 +10,8 @@
'use strict';
+import React from 'react';
+
if (process.env.NODE_ENV !== "production") {
(function() {
@@ -23,7 +25,6 @@ if (
) {
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
}
- var React = require('react');
var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
diff --git a/cjs/use-sync-external-store-shim.native.development.js b/cjs/use-sync-external-store-shim.native.development.js
index 5e2bebc..ae1e46d 100644
--- a/cjs/use-sync-external-store-shim.native.development.js
+++ b/cjs/use-sync-external-store-shim.native.development.js
@@ -10,6 +10,8 @@
'use strict';
+import React from 'react';
+
if (process.env.NODE_ENV !== "production") {
(function() {
@@ -23,7 +25,6 @@ if (
) {
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
}
- var React = require('react');
var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
diff --git a/cjs/use-sync-external-store-shim.native.production.min.js b/cjs/use-sync-external-store-shim.native.production.min.js
index 0e7f3dc..ac8e426 100644
--- a/cjs/use-sync-external-store-shim.native.production.min.js
+++ b/cjs/use-sync-external-store-shim.native.production.min.js
@@ -7,5 +7,7 @@
* 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}
+'use strict';
+import e from "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;
diff --git a/cjs/use-sync-external-store-shim.production.min.js b/cjs/use-sync-external-store-shim.production.min.js
index 0ca00c7..e457d83 100644
--- a/cjs/use-sync-external-store-shim.production.min.js
+++ b/cjs/use-sync-external-store-shim.production.min.js
@@ -7,5 +7,7 @@
* 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}
+'use strict';
+import e from "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;
diff --git a/cjs/use-sync-external-store-shim/with-selector.development.js b/cjs/use-sync-external-store-shim/with-selector.development.js
index 3c875ea..e7ec965 100644
--- a/cjs/use-sync-external-store-shim/with-selector.development.js
+++ b/cjs/use-sync-external-store-shim/with-selector.development.js
@@ -10,6 +10,9 @@
'use strict';
+import React from 'react';
+import shim from 'use-sync-external-store/shim';
+
if (process.env.NODE_ENV !== "production") {
(function() {
@@ -23,8 +26,6 @@ if (
) {
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
}
- var React = require('react');
-var shim = require('use-sync-external-store/shim');
/**
* inlined Object.is polyfill to avoid requiring consumers ship their own
diff --git a/cjs/use-sync-external-store-shim/with-selector.production.min.js b/cjs/use-sync-external-store-shim/with-selector.production.min.js
index 84485da..201748b 100644
--- a/cjs/use-sync-external-store-shim/with-selector.production.min.js
+++ b/cjs/use-sync-external-store-shim/with-selector.production.min.js
@@ -7,6 +7,9 @@
* 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;
+'use strict';
+import h from "react";
+import n from "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};
diff --git a/cjs/use-sync-external-store-with-selector.development.js b/cjs/use-sync-external-store-with-selector.development.js
index eacc4be..d99209e 100644
--- a/cjs/use-sync-external-store-with-selector.development.js
+++ b/cjs/use-sync-external-store-with-selector.development.js
@@ -10,6 +10,8 @@
'use strict';
+import React from 'react';
+
if (process.env.NODE_ENV !== "production") {
(function() {
@@ -23,7 +25,6 @@ if (
) {
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
}
- var React = require('react');
/**
* inlined Object.is polyfill to avoid requiring consumers ship their own
diff --git a/cjs/use-sync-external-store-with-selector.production.min.js b/cjs/use-sync-external-store-with-selector.production.min.js
index 06bad1a..7ea7656 100644
--- a/cjs/use-sync-external-store-with-selector.production.min.js
+++ b/cjs/use-sync-external-store-with-selector.production.min.js
@@ -7,6 +7,10 @@
* 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};
+'use strict';
+import g from "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
+};
diff --git a/cjs/use-sync-external-store.development.js b/cjs/use-sync-external-store.development.js
index 82368bc..7d6ddb3 100644
--- a/cjs/use-sync-external-store.development.js
+++ b/cjs/use-sync-external-store.development.js
@@ -10,6 +10,8 @@
'use strict';
+import React from 'react';
+
if (process.env.NODE_ENV !== "production") {
(function() {
@@ -23,7 +25,6 @@ if (
) {
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
}
- var React = require('react');
var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
diff --git a/cjs/use-sync-external-store.production.min.js b/cjs/use-sync-external-store.production.min.js
index 8d684a6..927067e 100644
--- a/cjs/use-sync-external-store.production.min.js
+++ b/cjs/use-sync-external-store.production.min.js
@@ -7,4 +7,8 @@
* 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;
+'use strict';
+
+import { useSyncExternalStore } from "react";
+
+exports.useSyncExternalStore = useSyncExternalStore;