REST conventions for MobX, providing Model and Collection classes with built-in CRUD actions (fetch, save, destroy, etc.) to minimize boilerplate for API interactions. Current stable version is 11.0.0, released sporadically. Key differentiators: integrates with MobX observable state management, supports automatic synchronization with server via RESTful endpoints, and includes ready-to-use React example. Ships TypeScript definitions.
npm install mobx-restNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Defines Task model and Collection, fetches tasks, creates, updates, and deletes a task via REST.
Upgrade mobx to ^6.3.2 or later.
Use ES import syntax: import { Model } from 'mobx-rest'.Initialize attributes directly in constructor instead.
Provide urlRoot() method or assign model to a collection.
Wrap modifications in action() or configure MobX with enforceActions: 'never'.
Change to import { Model } from 'mobx-rest'Wrap model.set() calls in runInAction() or configure MobX with enforceActions: 'never'.
Ensure urlRoot() or url() returns correct endpoint.
npm install mobx@^6.3.2