UNPKG

42 kBSource Map (JSON)View Raw
1{"version":3,"file":"mobxreactlite.cjs.development.js","sources":["../src/utils/assertEnvironment.ts","../src/utils/observerBatching.ts","../src/utils/utils.ts","../src/utils/printDebugValue.ts","../src/utils/FinalizationRegistryWrapper.ts","../src/utils/reactionCleanupTrackingCommon.ts","../src/utils/createReactionCleanupTrackingUsingFinalizationRegister.ts","../src/utils/createTimerBasedReactionCleanupTracking.ts","../src/utils/reactionCleanupTracking.ts","../src/staticRendering.ts","../src/useObserver.ts","../src/observer.ts","../src/ObserverComponent.ts","../src/useLocalObservable.ts","../src/useAsObservableSource.ts","../src/useLocalStore.ts","../src/index.ts"],"sourcesContent":["import { makeObservable } from \"mobx\"\nimport { useState } from \"react\"\n\nif (!useState) {\n throw new Error(\"mobx-react-lite requires React with Hooks support\")\n}\nif (!makeObservable) {\n throw new Error(\"mobx-react-lite@3 requires mobx at least version 6 to be available\")\n}\n","import { configure } from \"mobx\"\n\nexport function defaultNoopBatch(callback: () => void) {\n callback()\n}\n\nexport function observerBatching(reactionScheduler: any) {\n if (!reactionScheduler) {\n reactionScheduler = defaultNoopBatch\n if (\"production\" !== process.env.NODE_ENV) {\n console.warn(\n \"[MobX] Failed to get unstable_batched updates from react-dom / react-native\"\n )\n }\n }\n configure({ reactionScheduler })\n}\n\nexport const isObserverBatched = () => {\n if (\"production\" !== process.env.NODE_ENV) {\n console.warn(\"[MobX] Deprecated\")\n }\n\n return true\n}\n","const deprecatedMessages: string[] = []\n\nexport function useDeprecated(msg: string) {\n if (!deprecatedMessages.includes(msg)) {\n deprecatedMessages.push(msg)\n console.warn(msg)\n }\n}\n","import { getDependencyTree, Reaction } from \"mobx\"\n\nexport function printDebugValue(v: Reaction) {\n return getDependencyTree(v)\n}\n","declare class FinalizationRegistryType<T> {\n constructor(cleanup: (cleanupToken: T) => void)\n register(object: object, cleanupToken: T, unregisterToken?: object): void\n unregister(unregisterToken: object): void\n}\n\ndeclare const FinalizationRegistry: typeof FinalizationRegistryType | undefined\n\nconst FinalizationRegistryLocal =\n typeof FinalizationRegistry === \"undefined\" ? undefined : FinalizationRegistry\n\nexport { FinalizationRegistryLocal as FinalizationRegistry }\n","import { Reaction } from \"mobx\"\n\nexport function createTrackingData(reaction: Reaction) {\n const trackingData: IReactionTracking = {\n reaction,\n mounted: false,\n changedBeforeMount: false,\n cleanAt: Date.now() + CLEANUP_LEAKED_REACTIONS_AFTER_MILLIS\n }\n return trackingData\n}\n\n/**\n * Unified api for timers/Finalization registry cleanups\n * This abstraction make useObserver much simpler\n */\nexport interface ReactionCleanupTracking {\n /**\n *\n * @param reaction The reaction to cleanup\n * @param objectRetainedByReact This will be in actual use only when FinalizationRegister is in use\n */\n addReactionToTrack(\n reactionTrackingRef: React.MutableRefObject<IReactionTracking | null>,\n reaction: Reaction,\n objectRetainedByReact: object\n ): IReactionTracking\n recordReactionAsCommitted(reactionRef: React.MutableRefObject<IReactionTracking | null>): void\n forceCleanupTimerToRunNowForTests(): void\n resetCleanupScheduleForTests(): void\n}\n\nexport interface IReactionTracking {\n /** The Reaction created during first render, which may be leaked */\n reaction: Reaction\n /**\n * The time (in ticks) at which point we should dispose of the reaction\n * if this component hasn't yet been fully mounted.\n */\n cleanAt: number\n\n /**\n * Whether the component has yet completed mounting (for us, whether\n * its useEffect has run)\n */\n mounted: boolean\n\n /**\n * Whether the observables that the component is tracking changed between\n * the first render and the first useEffect.\n */\n changedBeforeMount: boolean\n\n /**\n * In case we are using finalization registry based cleanup,\n * this will hold the cleanup token associated with this reaction\n */\n finalizationRegistryCleanupToken?: number\n}\n\n/**\n * The minimum time before we'll clean up a Reaction created in a render\n * for a component that hasn't managed to run its effects. This needs to\n * be big enough to ensure that a component won't turn up and have its\n * effects run without being re-rendered.\n */\nexport const CLEANUP_LEAKED_REACTIONS_AFTER_MILLIS = 10_000\n\n/**\n * The frequency with which we'll check for leaked reactions.\n */\nexport const CLEANUP_TIMER_LOOP_MILLIS = 10_000\n","import { FinalizationRegistry as FinalizationRegistryMaybeUndefined } from \"./FinalizationRegistryWrapper\"\nimport { Reaction } from \"mobx\"\nimport {\n ReactionCleanupTracking,\n IReactionTracking,\n createTrackingData\n} from \"./reactionCleanupTrackingCommon\"\n\n/**\n * FinalizationRegistry-based uncommitted reaction cleanup\n */\nexport function createReactionCleanupTrackingUsingFinalizationRegister(\n FinalizationRegistry: NonNullable<typeof FinalizationRegistryMaybeUndefined>\n): ReactionCleanupTracking {\n const cleanupTokenToReactionTrackingMap = new Map<number, IReactionTracking>()\n let globalCleanupTokensCounter = 1\n\n const registry = new FinalizationRegistry(function cleanupFunction(token: number) {\n const trackedReaction = cleanupTokenToReactionTrackingMap.get(token)\n if (trackedReaction) {\n trackedReaction.reaction.dispose()\n cleanupTokenToReactionTrackingMap.delete(token)\n }\n })\n\n return {\n addReactionToTrack(\n reactionTrackingRef: React.MutableRefObject<IReactionTracking | null>,\n reaction: Reaction,\n objectRetainedByReact: object\n ) {\n const token = globalCleanupTokensCounter++\n\n registry.register(objectRetainedByReact, token, reactionTrackingRef)\n reactionTrackingRef.current = createTrackingData(reaction)\n reactionTrackingRef.current.finalizationRegistryCleanupToken = token\n cleanupTokenToReactionTrackingMap.set(token, reactionTrackingRef.current)\n\n return reactionTrackingRef.current\n },\n recordReactionAsCommitted(reactionRef: React.MutableRefObject<IReactionTracking | null>) {\n registry.unregister(reactionRef)\n\n if (reactionRef.current && reactionRef.current.finalizationRegistryCleanupToken) {\n cleanupTokenToReactionTrackingMap.delete(\n reactionRef.current.finalizationRegistryCleanupToken\n )\n }\n },\n forceCleanupTimerToRunNowForTests() {\n // When FinalizationRegistry in use, this this is no-op\n },\n resetCleanupScheduleForTests() {\n // When FinalizationRegistry in use, this this is no-op\n }\n }\n}\n","import { Reaction } from \"mobx\"\nimport {\n ReactionCleanupTracking,\n IReactionTracking,\n CLEANUP_TIMER_LOOP_MILLIS,\n createTrackingData\n} from \"./reactionCleanupTrackingCommon\"\n\n/**\n * timers, gc-style, uncommitted reaction cleanup\n */\nexport function createTimerBasedReactionCleanupTracking(): ReactionCleanupTracking {\n /**\n * Reactions created by components that have yet to be fully mounted.\n */\n const uncommittedReactionRefs: Set<React.MutableRefObject<IReactionTracking | null>> = new Set()\n\n /**\n * Latest 'uncommitted reactions' cleanup timer handle.\n */\n let reactionCleanupHandle: ReturnType<typeof setTimeout> | undefined\n\n /* istanbul ignore next */\n /**\n * Only to be used by test functions; do not export outside of mobx-react-lite\n */\n function forceCleanupTimerToRunNowForTests() {\n // This allows us to control the execution of the cleanup timer\n // to force it to run at awkward times in unit tests.\n if (reactionCleanupHandle) {\n clearTimeout(reactionCleanupHandle)\n cleanUncommittedReactions()\n }\n }\n\n /* istanbul ignore next */\n function resetCleanupScheduleForTests() {\n if (uncommittedReactionRefs.size > 0) {\n for (const ref of uncommittedReactionRefs) {\n const tracking = ref.current\n if (tracking) {\n tracking.reaction.dispose()\n ref.current = null\n }\n }\n uncommittedReactionRefs.clear()\n }\n\n if (reactionCleanupHandle) {\n clearTimeout(reactionCleanupHandle)\n reactionCleanupHandle = undefined\n }\n }\n\n function ensureCleanupTimerRunning() {\n if (reactionCleanupHandle === undefined) {\n reactionCleanupHandle = setTimeout(cleanUncommittedReactions, CLEANUP_TIMER_LOOP_MILLIS)\n }\n }\n\n function scheduleCleanupOfReactionIfLeaked(\n ref: React.MutableRefObject<IReactionTracking | null>\n ) {\n uncommittedReactionRefs.add(ref)\n\n ensureCleanupTimerRunning()\n }\n\n function recordReactionAsCommitted(\n reactionRef: React.MutableRefObject<IReactionTracking | null>\n ) {\n uncommittedReactionRefs.delete(reactionRef)\n }\n\n /**\n * Run by the cleanup timer to dispose any outstanding reactions\n */\n function cleanUncommittedReactions() {\n reactionCleanupHandle = undefined\n\n // Loop through all the candidate leaked reactions; those older\n // than CLEANUP_LEAKED_REACTIONS_AFTER_MILLIS get tidied.\n\n const now = Date.now()\n uncommittedReactionRefs.forEach(ref => {\n const tracking = ref.current\n if (tracking) {\n if (now >= tracking.cleanAt) {\n // It's time to tidy up this leaked reaction.\n tracking.reaction.dispose()\n ref.current = null\n uncommittedReactionRefs.delete(ref)\n }\n }\n })\n\n if (uncommittedReactionRefs.size > 0) {\n // We've just finished a round of cleanups but there are still\n // some leak candidates outstanding.\n ensureCleanupTimerRunning()\n }\n }\n\n return {\n addReactionToTrack(\n reactionTrackingRef: React.MutableRefObject<IReactionTracking | null>,\n reaction: Reaction,\n /**\n * On timer based implementation we don't really need this object,\n * but we keep the same api\n */\n objectRetainedByReact: unknown\n ) {\n reactionTrackingRef.current = createTrackingData(reaction)\n scheduleCleanupOfReactionIfLeaked(reactionTrackingRef)\n return reactionTrackingRef.current\n },\n recordReactionAsCommitted,\n forceCleanupTimerToRunNowForTests,\n resetCleanupScheduleForTests\n }\n}\n","import { FinalizationRegistry as FinalizationRegistryMaybeUndefined } from \"./FinalizationRegistryWrapper\"\nimport { createReactionCleanupTrackingUsingFinalizationRegister } from \"./createReactionCleanupTrackingUsingFinalizationRegister\"\nimport { createTimerBasedReactionCleanupTracking } from \"./createTimerBasedReactionCleanupTracking\"\nexport { IReactionTracking } from \"./reactionCleanupTrackingCommon\"\n\nconst {\n addReactionToTrack,\n recordReactionAsCommitted,\n resetCleanupScheduleForTests,\n forceCleanupTimerToRunNowForTests\n} = FinalizationRegistryMaybeUndefined\n ? createReactionCleanupTrackingUsingFinalizationRegister(FinalizationRegistryMaybeUndefined)\n : createTimerBasedReactionCleanupTracking()\n\nexport {\n addReactionToTrack,\n recordReactionAsCommitted,\n resetCleanupScheduleForTests,\n forceCleanupTimerToRunNowForTests\n}\n","let globalIsUsingStaticRendering = false\n\nexport function enableStaticRendering(enable: boolean) {\n globalIsUsingStaticRendering = enable\n}\n\nexport function isUsingStaticRendering(): boolean {\n return globalIsUsingStaticRendering\n}\n","import { Reaction } from \"mobx\"\nimport React from \"react\"\nimport { printDebugValue } from \"./utils/printDebugValue\"\nimport {\n addReactionToTrack,\n IReactionTracking,\n recordReactionAsCommitted\n} from \"./utils/reactionCleanupTracking\"\nimport { isUsingStaticRendering } from \"./staticRendering\"\n\nfunction observerComponentNameFor(baseComponentName: string) {\n return `observer${baseComponentName}`\n}\n\n/**\n * We use class to make it easier to detect in heap snapshots by name\n */\nclass ObjectToBeRetainedByReact {}\n\nfunction objectToBeRetainedByReactFactory() {\n return new ObjectToBeRetainedByReact()\n}\n\nexport function useObserver<T>(fn: () => T, baseComponentName: string = \"observed\"): T {\n if (isUsingStaticRendering()) {\n return fn()\n }\n\n const [objectRetainedByReact] = React.useState(objectToBeRetainedByReactFactory)\n // Force update, see #2982\n const [, setState] = React.useState()\n const forceUpdate = () => setState([] as any)\n\n // StrictMode/ConcurrentMode/Suspense may mean that our component is\n // rendered and abandoned multiple times, so we need to track leaked\n // Reactions.\n const reactionTrackingRef = React.useRef<IReactionTracking | null>(null)\n\n if (!reactionTrackingRef.current) {\n // First render for this component (or first time since a previous\n // reaction from an abandoned render was disposed).\n\n const newReaction = new Reaction(observerComponentNameFor(baseComponentName), () => {\n // Observable has changed, meaning we want to re-render\n // BUT if we're a component that hasn't yet got to the useEffect()\n // stage, we might be a component that _started_ to render, but\n // got dropped, and we don't want to make state changes then.\n // (It triggers warnings in StrictMode, for a start.)\n if (trackingData.mounted) {\n // We have reached useEffect(), so we're mounted, and can trigger an update\n forceUpdate()\n } else {\n // We haven't yet reached useEffect(), so we'll need to trigger a re-render\n // when (and if) useEffect() arrives.\n trackingData.changedBeforeMount = true\n }\n })\n\n const trackingData = addReactionToTrack(\n reactionTrackingRef,\n newReaction,\n objectRetainedByReact\n )\n }\n\n const { reaction } = reactionTrackingRef.current!\n React.useDebugValue(reaction, printDebugValue)\n\n React.useEffect(() => {\n // Called on first mount only\n recordReactionAsCommitted(reactionTrackingRef)\n\n if (reactionTrackingRef.current) {\n // Great. We've already got our reaction from our render;\n // all we need to do is to record that it's now mounted,\n // to allow future observable changes to trigger re-renders\n reactionTrackingRef.current.mounted = true\n // Got a change before first mount, force an update\n if (reactionTrackingRef.current.changedBeforeMount) {\n reactionTrackingRef.current.changedBeforeMount = false\n forceUpdate()\n }\n } else {\n // The reaction we set up in our render has been disposed.\n // This can be due to bad timings of renderings, e.g. our\n // component was paused for a _very_ long time, and our\n // reaction got cleaned up\n\n // Re-create the reaction\n reactionTrackingRef.current = {\n reaction: new Reaction(observerComponentNameFor(baseComponentName), () => {\n // We've definitely already been mounted at this point\n forceUpdate()\n }),\n mounted: true,\n changedBeforeMount: false,\n cleanAt: Infinity\n }\n forceUpdate()\n }\n\n return () => {\n reactionTrackingRef.current!.reaction.dispose()\n reactionTrackingRef.current = null\n }\n }, [])\n\n // render the original component, but have the\n // reaction track the observables, so that rendering\n // can be invalidated (see above) once a dependency changes\n let rendering!: T\n let exception\n reaction.track(() => {\n try {\n rendering = fn()\n } catch (e) {\n exception = e\n }\n })\n\n if (exception) {\n throw exception // re-throw any exceptions caught during rendering\n }\n\n return rendering\n}\n","import { forwardRef, memo } from \"react\"\n\nimport { isUsingStaticRendering } from \"./staticRendering\"\nimport { useObserver } from \"./useObserver\"\n\nlet warnObserverOptionsDeprecated = true\n\nconst hasSymbol = typeof Symbol === \"function\" && Symbol.for\n// Using react-is had some issues (and operates on elements, not on types), see #608 / #609\nconst ReactForwardRefSymbol = hasSymbol\n ? Symbol.for(\"react.forward_ref\")\n : typeof forwardRef === \"function\" && forwardRef((props: any) => null)[\"$$typeof\"]\n\nconst ReactMemoSymbol = hasSymbol\n ? Symbol.for(\"react.memo\")\n : typeof memo === \"function\" && memo((props: any) => null)[\"$$typeof\"]\n\nexport interface IObserverOptions {\n readonly forwardRef?: boolean\n}\n\nexport function observer<P extends object, TRef = {}>(\n baseComponent: React.ForwardRefRenderFunction<TRef, P>,\n options: IObserverOptions & { forwardRef: true }\n): React.MemoExoticComponent<\n React.ForwardRefExoticComponent<React.PropsWithoutRef<P> & React.RefAttributes<TRef>>\n>\n\nexport function observer<P extends object, TRef = {}>(\n baseComponent: React.ForwardRefExoticComponent<\n React.PropsWithoutRef<P> & React.RefAttributes<TRef>\n >\n): React.MemoExoticComponent<\n React.ForwardRefExoticComponent<React.PropsWithoutRef<P> & React.RefAttributes<TRef>>\n>\n\nexport function observer<P extends object>(\n baseComponent: React.FunctionComponent<P>,\n options?: IObserverOptions\n): React.FunctionComponent<P>\n\nexport function observer<\n C extends React.FunctionComponent<any> | React.ForwardRefRenderFunction<any>,\n Options extends IObserverOptions\n>(\n baseComponent: C,\n options?: Options\n): Options extends { forwardRef: true }\n ? C extends React.ForwardRefRenderFunction<infer TRef, infer P>\n ? C &\n React.MemoExoticComponent<\n React.ForwardRefExoticComponent<\n React.PropsWithoutRef<P> & React.RefAttributes<TRef>\n >\n >\n : never /* forwardRef set for a non forwarding component */\n : C & { displayName: string }\n\n// n.b. base case is not used for actual typings or exported in the typing files\nexport function observer<P extends object, TRef = {}>(\n baseComponent:\n | React.ForwardRefRenderFunction<TRef, P>\n | React.FunctionComponent<P>\n | React.ForwardRefExoticComponent<React.PropsWithoutRef<P> & React.RefAttributes<TRef>>,\n // TODO remove in next major\n options?: IObserverOptions\n) {\n if (process.env.NODE_ENV !== \"production\" && warnObserverOptionsDeprecated && options) {\n warnObserverOptionsDeprecated = false\n console.warn(\n `[mobx-react-lite] \\`observer(fn, { forwardRef: true })\\` is deprecated, use \\`observer(React.forwardRef(fn))\\``\n )\n }\n\n if (ReactMemoSymbol && baseComponent[\"$$typeof\"] === ReactMemoSymbol) {\n throw new Error(\n `[mobx-react-lite] You are trying to use \\`observer\\` on a function component wrapped in either another \\`observer\\` or \\`React.memo\\`. The observer already applies 'React.memo' for you.`\n )\n }\n\n // The working of observer is explained step by step in this talk: https://www.youtube.com/watch?v=cPF4iBedoF0&feature=youtu.be&t=1307\n if (isUsingStaticRendering()) {\n return baseComponent\n }\n\n let useForwardRef = options?.forwardRef ?? false\n let render = baseComponent\n\n const baseComponentName = baseComponent.displayName || baseComponent.name\n\n // If already wrapped with forwardRef, unwrap,\n // so we can patch render and apply memo\n if (ReactForwardRefSymbol && baseComponent[\"$$typeof\"] === ReactForwardRefSymbol) {\n useForwardRef = true\n render = baseComponent[\"render\"]\n if (typeof render !== \"function\") {\n throw new Error(\n `[mobx-react-lite] \\`render\\` property of ForwardRef was not a function`\n )\n }\n }\n\n let observerComponent = (props: any, ref: React.Ref<TRef>) => {\n return useObserver(() => render(props, ref), baseComponentName)\n }\n\n // Don't set `displayName` for anonymous components,\n // so the `displayName` can be customized by user, see #3192.\n if (baseComponentName !== \"\") {\n ;(observerComponent as React.FunctionComponent).displayName = baseComponentName\n }\n\n // Support legacy context: `contextTypes` must be applied before `memo`\n if ((baseComponent as any).contextTypes) {\n ;(observerComponent as React.FunctionComponent).contextTypes = (\n baseComponent as any\n ).contextTypes\n }\n\n if (useForwardRef) {\n // `forwardRef` must be applied prior `memo`\n // `forwardRef(observer(cmp))` throws:\n // \"forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))\"\n observerComponent = forwardRef(observerComponent)\n }\n\n // memo; we are not interested in deep updates\n // in props; we assume that if deep objects are changed,\n // this is in observables, which would have been tracked anyway\n observerComponent = memo(observerComponent)\n\n copyStaticProperties(baseComponent, observerComponent)\n\n if (\"production\" !== process.env.NODE_ENV) {\n Object.defineProperty(observerComponent, \"contextTypes\", {\n set() {\n throw new Error(\n `[mobx-react-lite] \\`${\n this.displayName || this.type?.displayName || \"Component\"\n }.contextTypes\\` must be set before applying \\`observer\\`.`\n )\n }\n })\n }\n\n return observerComponent\n}\n\n// based on https://github.com/mridgway/hoist-non-react-statics/blob/master/src/index.js\nconst hoistBlackList: any = {\n $$typeof: true,\n render: true,\n compare: true,\n type: true,\n // Don't redefine `displayName`,\n // it's defined as getter-setter pair on `memo` (see #3192).\n displayName: true\n}\n\nfunction copyStaticProperties(base: any, target: any) {\n Object.keys(base).forEach(key => {\n if (!hoistBlackList[key]) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(base, key)!)\n }\n })\n}\n","import { useObserver } from \"./useObserver\"\n\ninterface IObserverProps {\n children?(): React.ReactElement | null\n render?(): React.ReactElement | null\n}\n\nfunction ObserverComponent({ children, render }: IObserverProps) {\n const component = children || render\n if (typeof component !== \"function\") {\n return null\n }\n return useObserver(component)\n}\nif (\"production\" !== process.env.NODE_ENV) {\n ObserverComponent.propTypes = {\n children: ObserverPropsCheck,\n render: ObserverPropsCheck\n }\n}\nObserverComponent.displayName = \"Observer\"\n\nexport { ObserverComponent as Observer }\n\nfunction ObserverPropsCheck(\n props: { [k: string]: any },\n key: string,\n componentName: string,\n location: any,\n propFullName: string\n) {\n const extraKey = key === \"children\" ? \"render\" : \"children\"\n const hasProp = typeof props[key] === \"function\"\n const hasExtraProp = typeof props[extraKey] === \"function\"\n if (hasProp && hasExtraProp) {\n return new Error(\n \"MobX Observer: Do not use children and render in the same time in`\" + componentName\n )\n }\n\n if (hasProp || hasExtraProp) {\n return null\n }\n return new Error(\n \"Invalid prop `\" +\n propFullName +\n \"` of type `\" +\n typeof props[key] +\n \"` supplied to\" +\n \" `\" +\n componentName +\n \"`, expected `function`.\"\n )\n}\n","import { observable, AnnotationsMap } from \"mobx\"\nimport { useState } from \"react\"\n\nexport function useLocalObservable<TStore extends Record<string, any>>(\n initializer: () => TStore,\n annotations?: AnnotationsMap<TStore, never>\n): TStore {\n return useState(() => observable(initializer(), annotations, { autoBind: true }))[0]\n}\n","import { useDeprecated } from \"./utils/utils\"\nimport { observable, runInAction } from \"mobx\"\nimport { useState } from \"react\"\n\nexport function useAsObservableSource<TSource extends object>(current: TSource): TSource {\n if (\"production\" !== process.env.NODE_ENV)\n useDeprecated(\n \"[mobx-react-lite] 'useAsObservableSource' is deprecated, please store the values directly in an observable, for example by using 'useLocalObservable', and sync future updates using 'useEffect' when needed. See the README for examples.\"\n )\n const [res] = useState(() => observable(current, {}, { deep: false }))\n runInAction(() => {\n Object.assign(res, current)\n })\n return res\n}\n","import { observable } from \"mobx\"\nimport { useState } from \"react\"\n\nimport { useDeprecated } from \"./utils/utils\"\nimport { useAsObservableSource } from \"./useAsObservableSource\"\n\nexport function useLocalStore<TStore extends Record<string, any>>(initializer: () => TStore): TStore\nexport function useLocalStore<TStore extends Record<string, any>, TSource extends object>(\n initializer: (source: TSource) => TStore,\n current: TSource\n): TStore\nexport function useLocalStore<TStore extends Record<string, any>, TSource extends object>(\n initializer: (source?: TSource) => TStore,\n current?: TSource\n): TStore {\n if (\"production\" !== process.env.NODE_ENV)\n useDeprecated(\n \"[mobx-react-lite] 'useLocalStore' is deprecated, use 'useLocalObservable' instead.\"\n )\n const source = current && useAsObservableSource(current)\n return useState(() => observable(initializer(source), undefined, { autoBind: true }))[0]\n}\n","import \"./utils/assertEnvironment\"\n\nimport { unstable_batchedUpdates as batch } from \"./utils/reactBatchedUpdates\"\nimport { observerBatching } from \"./utils/observerBatching\"\nimport { useDeprecated } from \"./utils/utils\"\nimport { useObserver as useObserverOriginal } from \"./useObserver\"\nimport { enableStaticRendering } from \"./staticRendering\"\n\nobserverBatching(batch)\n\nexport { isUsingStaticRendering, enableStaticRendering } from \"./staticRendering\"\nexport { observer, IObserverOptions } from \"./observer\"\nexport { Observer } from \"./ObserverComponent\"\nexport { useLocalObservable } from \"./useLocalObservable\"\nexport { useLocalStore } from \"./useLocalStore\"\nexport { useAsObservableSource } from \"./useAsObservableSource\"\nexport { resetCleanupScheduleForTests as clearTimers } from \"./utils/reactionCleanupTracking\"\n\nexport function useObserver<T>(fn: () => T, baseComponentName: string = \"observed\"): T {\n if (\"production\" !== process.env.NODE_ENV) {\n useDeprecated(\n \"[mobx-react-lite] 'useObserver(fn)' is deprecated. Use `<Observer>{fn}</Observer>` instead, or wrap the entire component in `observer`.\"\n )\n }\n return useObserverOriginal(fn, baseComponentName)\n}\n\nexport { isObserverBatched, observerBatching } from \"./utils/observerBatching\"\n\nexport function useStaticRendering(enable: boolean) {\n if (\"production\" !== process.env.NODE_ENV) {\n console.warn(\n \"[mobx-react-lite] 'useStaticRendering' is deprecated, use 'enableStaticRendering' instead\"\n )\n }\n enableStaticRendering(enable)\n}\n"],"names":["useState","Error","makeObservable","defaultNoopBatch","callback","observerBatching","reactionScheduler","console","warn","configure","isObserverBatched","deprecatedMessages","useDeprecated","msg","includes","push","printDebugValue","v","getDependencyTree","FinalizationRegistryLocal","FinalizationRegistry","undefined","createTrackingData","reaction","trackingData","mounted","changedBeforeMount","cleanAt","Date","now","CLEANUP_LEAKED_REACTIONS_AFTER_MILLIS","CLEANUP_TIMER_LOOP_MILLIS","createReactionCleanupTrackingUsingFinalizationRegister","cleanupTokenToReactionTrackingMap","Map","globalCleanupTokensCounter","registry","cleanupFunction","token","trackedReaction","get","dispose","addReactionToTrack","reactionTrackingRef","objectRetainedByReact","register","current","finalizationRegistryCleanupToken","set","recordReactionAsCommitted","reactionRef","unregister","forceCleanupTimerToRunNowForTests","resetCleanupScheduleForTests","createTimerBasedReactionCleanupTracking","uncommittedReactionRefs","Set","reactionCleanupHandle","clearTimeout","cleanUncommittedReactions","size","ref","tracking","clear","ensureCleanupTimerRunning","setTimeout","scheduleCleanupOfReactionIfLeaked","add","forEach","FinalizationRegistryMaybeUndefined","globalIsUsingStaticRendering","enableStaticRendering","enable","isUsingStaticRendering","observerComponentNameFor","baseComponentName","ObjectToBeRetainedByReact","objectToBeRetainedByReactFactory","useObserver","fn","React","setState","forceUpdate","useRef","newReaction","Reaction","useDebugValue","useEffect","Infinity","rendering","exception","track","e","warnObserverOptionsDeprecated","hasSymbol","Symbol","ReactForwardRefSymbol","forwardRef","props","ReactMemoSymbol","memo","observer","baseComponent","options","process","useForwardRef","render","displayName","name","observerComponent","contextTypes","copyStaticProperties","Object","defineProperty","type","hoistBlackList","$$typeof","compare","base","target","keys","key","getOwnPropertyDescriptor","ObserverComponent","children","component","propTypes","ObserverPropsCheck","componentName","location","propFullName","extraKey","hasProp","hasExtraProp","useLocalObservable","initializer","annotations","observable","autoBind","useAsObservableSource","deep","res","runInAction","assign","useLocalStore","source","batch","useObserverOriginal","useStaticRendering"],"mappings":";;;;;;;;;;;AAGA,IAAI,CAACA,c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