📄️ API: createChunk
Define a self-contained, type-safe MobX store slice ("chunk") with optional custom logic, persistence, and async support.
📄️ API: useChunk
React hook for creating and managing a local MobX chunk store instance for the lifetime of a component.
📄️ API: useValues
React hook for batch-subscribing to multiple MobX chunk-derived values in one call. Re-renders your component when any selected value changes.
📄️ API: useComputed
React hook for subscribing to a single MobX chunk-derived value or loading flag. Re-renders your component when the selected value changes.
📄️ API: combineAsync
Utility for merging multiple builder functions into a single flat API of asynchronous methods. Each builder receives a shared context (self) and returns an object of async functions; combineAsync binds them into one API, preserving original signatures.
📄️ API: useStoreInitialized
React hook to defer rendering until specified MobX store instances are initialized. Returns a boolean flag that toggles from false to true immediately after the provided stores are referenced on component mount.
📄️ API: configurePersistenceEngine
Global configuration for persisting state fields in mobx-chunk. Plug any storage engine by providing CRUD methods for string-based keys and values.
📄️ API: useQuery
React hook for subscribing to a MobX-powered query. Auto-fetches on mount (unless disabled), subscribes to observable state, and re-renders the component when data, error, or status changes.
📄️ API: addActionInterceptor / removeActionInterceptor
Register (and unregister) global middleware functions that intercept chunk async actions. Useful for validation, logging, or performance tracking.
📄️ API: useInfiniteQuery
React hook for subscribing to a MobX-powered infinite query. Loads the first page on mount, provides fetchNextPage for pagination, and re-renders on state changes.
📄️ API: selectorFn
Marks a view function as a parameterized method so it is not treated as a computed getter.
📄️ API: useMutation
React hook for subscribing to a MobX-powered mutation. Provides mutate (fire-and-forget) and mutateAsync (returns Promise), and re-renders when the mutation state changes.
📄️ API: combineQueries
Utility for merging multiple query builder functions into a single builder. Works identically to combineAsync but for query/mutation/infinite query definitions.