UNPKG

1.79 kBJavaScriptView Raw
1var _a;
2import "./utils/assertEnvironment";
3import { unstable_batchedUpdates as batch } from "./utils/reactBatchedUpdates";
4import { observerBatching } from "./utils/observerBatching";
5import { useDeprecated } from "./utils/utils";
6import { useObserver as useObserverOriginal } from "./useObserver";
7import { enableStaticRendering } from "./staticRendering";
8import { observerFinalizationRegistry } from "./utils/observerFinalizationRegistry";
9observerBatching(batch);
10export { isUsingStaticRendering, enableStaticRendering } from "./staticRendering";
11export { observer } from "./observer";
12export { Observer } from "./ObserverComponent";
13export { useLocalObservable } from "./useLocalObservable";
14export { useLocalStore } from "./useLocalStore";
15export { useAsObservableSource } from "./useAsObservableSource";
16export { observerFinalizationRegistry as _observerFinalizationRegistry };
17export var clearTimers = (_a = observerFinalizationRegistry["finalizeAllImmediately"]) !== null && _a !== void 0 ? _a : (function () { });
18export function useObserver(fn, baseComponentName) {
19 if (baseComponentName === void 0) { baseComponentName = "observed"; }
20 if ("production" !== process.env.NODE_ENV) {
21 useDeprecated("[mobx-react-lite] 'useObserver(fn)' is deprecated. Use `<Observer>{fn}</Observer>` instead, or wrap the entire component in `observer`.");
22 }
23 return useObserverOriginal(fn, baseComponentName);
24}
25export { isObserverBatched, observerBatching } from "./utils/observerBatching";
26export function useStaticRendering(enable) {
27 if ("production" !== process.env.NODE_ENV) {
28 console.warn("[mobx-react-lite] 'useStaticRendering' is deprecated, use 'enableStaticRendering' instead");
29 }
30 enableStaticRendering(enable);
31}
32//# sourceMappingURL=index.js.map
\No newline at end of file