UNPKG

1.58 kBJavaScriptView Raw
1"use strict";
2
3exports.__esModule = true;
4var _exportNames = {
5 batch: true
6};
7Object.defineProperty(exports, "batch", {
8 enumerable: true,
9 get: function () {
10 return _reactBatchedUpdates.unstable_batchedUpdates;
11 }
12});
13
14var _react = require("react");
15
16var _withSelector = require("use-sync-external-store/with-selector");
17
18var _reactBatchedUpdates = require("./utils/reactBatchedUpdates");
19
20var _batch = require("./utils/batch");
21
22var _useSelector = require("./hooks/useSelector");
23
24var _connect = require("./components/connect");
25
26var _exports = require("./exports");
27
28Object.keys(_exports).forEach(function (key) {
29 if (key === "default" || key === "__esModule") return;
30 if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
31 if (key in exports && exports[key] === _exports[key]) return;
32 Object.defineProperty(exports, key, {
33 enumerable: true,
34 get: function () {
35 return _exports[key];
36 }
37 });
38});
39// The secondary entry point assumes we are working with React 18, and thus have
40// useSyncExternalStore available. We can import that directly from React itself.
41// The useSyncExternalStoreWithSelector has to be imported, but we can use the
42// non-shim version. This shaves off the byte size of the shim.
43(0, _useSelector.initializeUseSelector)(_withSelector.useSyncExternalStoreWithSelector);
44(0, _connect.initializeConnect)(_react.useSyncExternalStore); // Enable batched updates in our subscriptions for use
45// with standard React renderers (ReactDOM, React Native)
46
47(0, _batch.setBatch)(_reactBatchedUpdates.unstable_batchedUpdates);
\No newline at end of file