📄️ API: createChunk
Define a self-contained, type-safe MobX store slice ("chunk") with optional custom logic, persistence, and async support.
📄️ 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: withStore
Higher-order component (HOC) for instantiating a local MobX chunk instance tied to a component's lifecycle. The store is created on mount and disposed on unmount, providing isolated state without prop drilling.
📄️ 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: addActionInterceptor
Register a global middleware function that intercepts chunk actions and async actions. Useful for validation, logging, or performance tracking.