A CanJS plugin that turns a DefineMap into a realtime REST model, providing automatic CRUD operations and real-time synchronization via the can-connect layer. Current stable version is 2.0.0, released as part of the CanJS 5+ ecosystem. It is maintained by Bitovi and follows a semantic versioning release cadence. Key differentiators include seamless integration with CanJS's define system and real-time behavior via can-connect's behavior architecture, making it distinct from generic REST clients like axios or fetch.
npm install can-define-realtime-rest-modelNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to define a realtime REST model using can-define-realtime-rest-model with a Todo map.
Use import syntax instead of require().
Import { realtimeRestModel } instead of relying on default.Migrate to can-connect with connection.get() pattern.
Ensure Map has an identity property (e.g., id: { type: 'number', identity: true }).Set url to a full path (e.g., '/api/todos').
Use import { defineRealtimeRestModel } from 'can-define-realtime-rest-model' in an ESM context.Pass a DefineMap constructor in the Map option.
Provide a DefineList constructor in the List option.