A MobX-based ORM (Object-Relational Mapping) library for managing API resources and other asynchronous data sources. Current stable version is 0.5.0-alpha.8, with a development cadence that has slowed since 2019. It integrates tightly with MobX, leveraging observable state and computed properties to manage relationships like belongsTo, hasMany, and hasOne. Key differentiators: unlike plain MobX stores, it provides a structured model layer with built-in normalization, foreign key resolution, and query support for API data, reducing boilerplate for complex data-fetching apps. However, it is in early alpha, lacks full CRUD, and may have breaking changes.
npm install mobx-ormNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Defines Author and Post models with relationships, adds records, and accesses related data via MobX observables.
Use MobX v4.10.0+ for compatibility; if on MobX v5+, may need shim or upgrade.
Consider using non-decorator patterns if stability is required.
Ensure foreign key values match the related model's primary key type (string vs number).
Flatten nested API responses manually or use a custom normalization step before adding.
Verify mobx-orm is installed with peer dependency mobx: npm install mobx-orm mobx
Install mobx: npm install mobx
Use repository.update() or set the foreign key value on the model (e.g., post.authorId = 2).