source: node_modules/react-redux/dist/rsc.mjs@ d24f17c

main
Last change on this file since d24f17c was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago

Initial commit

  • Property mode set to 100644
File size: 1.3 KB
Line 
1// src/utils/shallowEqual.ts
2function is(x, y) {
3 if (x === y) {
4 return x !== 0 || y !== 0 || 1 / x === 1 / y;
5 } else {
6 return x !== x && y !== y;
7 }
8}
9function shallowEqual(objA, objB) {
10 if (is(objA, objB))
11 return true;
12 if (typeof objA !== "object" || objA === null || typeof objB !== "object" || objB === null) {
13 return false;
14 }
15 const keysA = Object.keys(objA);
16 const keysB = Object.keys(objB);
17 if (keysA.length !== keysB.length)
18 return false;
19 for (let i = 0; i < keysA.length; i++) {
20 if (!Object.prototype.hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {
21 return false;
22 }
23 }
24 return true;
25}
26
27// src/index-rsc.ts
28function throwNotSupportedError(...args) {
29 throw new Error(
30 "This function is not supported in React Server Components. Please only use this export in a Client Component."
31 );
32}
33var ReactReduxContext = {};
34export {
35 throwNotSupportedError as Provider,
36 ReactReduxContext,
37 throwNotSupportedError as batch,
38 throwNotSupportedError as connect,
39 throwNotSupportedError as createDispatchHook,
40 throwNotSupportedError as createSelectorHook,
41 throwNotSupportedError as createStoreHook,
42 shallowEqual,
43 throwNotSupportedError as useDispatch,
44 throwNotSupportedError as useSelector,
45 throwNotSupportedError as useStore
46};
47//# sourceMappingURL=rsc.mjs.map
Note: See TracBrowser for help on using the repository browser.