Packages
OIMDB is split into focused npm packages. The core package owns the collection model and reactive primitives; integration packages add React, Redux, async stores, and persistence.
@oimdb/core
The foundational reactive collections, indexing, and event processing library.
npm install @oimdb/core
Includes:
createOIMCollectionKit— DX facade:{ queue, collection, indexFactory, select }OIMReactiveCollection— reactive entity store with canonical slotsOIMCollectionIndexFactory— creates derived, manual, and ordered indexes bound to a collectionOIMCollectionSelectors— reactive selector facade (byPk,entitiesBySetIndexKey, …)OIMReactiveObject— reactive key-value store for settings, flags, and single valuesOIMEffect— runs a side effect when dependencies changeOIMComputed— derives a value from dependencies, notifies on changeOIMComputeRuntime— schedules effects and computeds within the queue flush cycleOIMCollectionChangedFields— field-level change tracking on top of a collectionOIMCollectionOrderedListCommandStream— ordered list with incremental commands (insert/remove/move/set)OIMEventQueue+OIMEventQueueSchedulerFactory— configurable event batching and delivery
Core Model · Indexes and Selectors · Source on GitHub · npm
@oimdb/react
React hooks and context helpers built on useSyncExternalStore.
npm install @oimdb/react @oimdb/core
Includes:
OIMCollectionsProvider— React context for collectionsuseOIMCollectionsContext— typed collection accessuseSelectEntityByPk,useSelectEntitiesByIndexKeySetBased/ArrayBased— key-scoped hooks, re-render only on relevant changesuseSelectValueByObjectKey— watchOIMReactiveObjectkeys
React Guide · Source on GitHub · npm
@oimdb/redux-adapter
Production-ready Redux adapter for gradual migration or hybrid usage.
npm install @oimdb/redux-adapter @oimdb/core redux
Includes:
OIMDBReduxAdapter— creates Redux reducers backed by OIMDB collections and indexes- Middleware for auto-flushing queue after each Redux action
- Child reducers for two-way sync: Redux actions → OIMDB writes
- Custom state mappers for any Redux shape
Redux Adapter Guide · Source on GitHub · npm
@oimdb/async
Async collections and indexes for IndexedDB, remote APIs, and other async stores.
npm install @oimdb/async @oimdb/core
Includes:
OIMCollectionAsync/OIMReactiveCollectionAsyncOIMPkIndexManualAsync/OIMReactivePkIndexManualAsync- No in-memory cache — operations go directly to the async store
@oimdb/persist
Storage-agnostic persistence engine for OIMDB collections, objects, and manual indexes. The concrete storage backends ship as separate packages — install the engine plus the backend(s) you need.
npm install @oimdb/persist @oimdb/persist-localstorage @oimdb/core
Includes:
OIMPersistorandOIMPersistResource— persistor lifecycle and resource binding- Source adapters (
createCollectionSourceAdapter,createObjectSourceAdapter,createSetIndexSourceAdapter, …) createVersionedCodec— versioned codec for schema migrationsbyPkand the resource.onHydrate(reconcile)hook — merge a later hydrate (e.g. a durable cache) onto current state instead of replacing it (TOIMPersistHydrateReconcile)TOIM…types andIOIMAnyPersistResource- Lifecycle helpers:
hydrate,persist,start,stop,addResource, andremoveResource
Persist Guide · Source on GitHub · npm
@oimdb/persist-memory
In-memory Map backend for the persist engine. Ideal for tests, SSR, and server-side fill.
npm install @oimdb/persist @oimdb/persist-memory @oimdb/core
Includes:
createMemoryPersistor— persistor backed by an in-memoryMap
Persist Guide · Source on GitHub · npm
@oimdb/persist-localstorage
localStorage backend for the persist engine.
npm install @oimdb/persist @oimdb/persist-localstorage @oimdb/core
Includes:
createLocalStoragePersistor— persistor backed bylocalStorage
Persist Guide · Source on GitHub · npm
@oimdb/persist-idb
IndexedDB backend for the persist engine.
npm install @oimdb/persist @oimdb/persist-idb @oimdb/core
Includes:
createIndexedDbPersistor— persistor backed by IndexedDB
Persist Guide · Source on GitHub · npm
@oimdb/persist-json
JSON-dump backend for the persist engine — the SSR dehydrate/hydrate transport. Storage is a single plain JSON-serializable object, so the whole registered state can be JSON.stringify-ed on the server and seeded back on the client.
npm install @oimdb/persist @oimdb/persist-json @oimdb/core
Includes:
createJsonPersistor({ initial? })— persistor backed by a plain JSON object;initialseeds it from an SSR blobpersistor.dehydrate()— returns the JSON-serializable dump of everything persisted
Persist Guide · SSR Guide · Source on GitHub · npm
@oimdb/persist-async-kv
Async key-value backend for the persist engine — the async twin of @oimdb/persist-localstorage. Serializes snapshots to strings and stores them through any object implementing the small async TOIMAsyncKVLike interface. Built for React Native (AsyncStorage drops in directly) and Cordova native storage (via a thin adapter); Cordova webviews can also just use @oimdb/persist-localstorage or @oimdb/persist-idb.
npm install @oimdb/persist @oimdb/persist-async-kv @oimdb/core
Includes:
createAsyncKVPersistor({ storage })— persistor backed by anyTOIMAsyncKVLikestorage;storageis required (no global default), with optionalserialize/deserializecodecTOIMAsyncKVLike— the async key-value interface;@react-native-async-storage/async-storagesatisfies it directly, includingmultiGet/multiSetbatch writes
Persist Guide · Source on GitHub · npm
@oimdb/snapshot-manager
Tracks which entities changed across multiple collections and returns a consolidated snapshot on demand. Use for server sync, undo/redo, or change auditing.
npm install @oimdb/snapshot-manager @oimdb/core
Includes:
OIMSnapshotManager— accumulates changed PKs, delivers them viatakeSnapshot()- Bypasses queue coalescing — tracks every raw write, collapses to final entity state