CodeVetter · Repo Unpack · Data flow
mobxjs/mobx
Inputs enter through observable factories, annotation maps, setters, and user-supplied callbacks. Enhancers transform values, administrations retain them, and synchronous reads build dependency edges. Mutations invalidate those edges and schedule effects or React updates; conversion and transport examples define the boundary toward external storage.
- observable factory options select an enhancer; deepEnhancer recursively wraps supported containers and converts previously unwrapped functions into autoAction or flow.
- Object creation captures property descriptors before administration attachment, then initObservable batches annotation application; observable properties receive shared accessors backed by administration entries.
- ObservableValue.get reports observation; reportObserved records each observable once per derivation run, and bindDependencies removes obsolete edges and adds newly read dependencies.
- Boxed writes pass mutation diagnostics, optional interceptors, enhancement, and equality suppression before storing the value; accepted changes report invalidation and notify listeners.
- Arrays retain enhanced items behind a Proxy and report reads through one atom; Maps distinguish key existence from value observation and notify the keys atom when inserting new entries.
- ComputedValue.get branches between unobserved computation and tracked caching; trackAndCompute confirms propagation only for suspension, exceptions, or comparer-detected changes.
- React observation converts Reaction invalidation into a new Symbol snapshot and an onStoreChange callback; useSyncExternalStore consumes stable subscription functions, and unsubscribe disposes the Reaction.
- toJS caches converted observable containers to preserve cycles and leaves non-observable branches unchanged; the documented persistence example instead derives asJson and hands it to an application-provided transportLayer.saveTodo.