[d24f17c] | 1 | // src/utils/shallowEqual.ts
|
---|
| 2 | function 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 | }
|
---|
| 9 | function 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
|
---|
| 28 | function 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 | }
|
---|
| 33 | var ReactReduxContext = {};
|
---|
| 34 | export {
|
---|
| 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 |
---|