CodeVetter · Repo Unpack · Feature catalog
mobxjs/mobx
The developer-facing surface centers on observable data, derived values, and managed side effects. React adapters connect the same graph to function and class rendering. Companion packages provide lint diagnostics and migration transforms, while the website exposes reference documentation and generated error explanations.
- observable dispatches plain objects, arrays, Maps, and Sets to specialized factories, preserves already-observable values and other object instances, and boxes remaining inputs.
- makeObservable accepts explicit annotations; makeAutoObservable infers annotations, supports overrides, optimizes plain objects through extendObservable, and rejects superclass-based or already-observable targets in development.
- Observable modifiers support deep conversion, shallow containers, reference preservation, and structural equality; Stage 3 observable accessors and computed getters register lazy factories.
- autorun tracks its callback, reaction separates a tracked expression from an action-wrapped effect with equality and fireImmediately options, and when offers a disposable callback or cancellable promise with timeout/abort handling.
- action batches synchronous changes, while flow drives generators through action-wrapped continuations and returns a promise whose cancel method invokes generator cleanup and rejects with FlowCancellationError.
- React APIs include observer, Observer, useLocalObservable, and static-rendering toggles; lite handles memo and forwardRef, while mobx-react adds class observers and rejects unsupported custom shouldComponentUpdate behavior.
- The core exports collection utilities, observe/intercept, observation lifecycle hooks, toJS, dependency/observer trees, spy, and reaction-error registration; its development entrypoint can inject diagnostics into a devtools hook.
- Developer tooling includes five ESLint rules with legacy/flat recommended configurations, a jscodeshift CLI accepting directory/path flags and transform options, and website reference navigation plus generated numeric error documentation.