A CanJS plugin that connects a map (like DefineMap) to a RESTful API and automatically syncs changes in realtime via WebSockets or Server-Sent Events. Current stable version is 2.0.0. It builds on CanJS's realtime model layer, providing automatic serialization, unsaved data tracking, and conflict resolution. Different from generic REST clients by deep integration with CanJS's observable patterns and real-time update propagation. Released as part of the DoneJS ecosystem.
npm install can-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 map, create a realtime REST connection, and save an instance, triggering real-time updates.
Use import syntax or dynamic import().
Update to pass an options object instead of a constructor.
Ensure your map has an identity property (usually 'id') with identity: true.
Use a server that implements realtime channels (WebSocket/SSE).
Change to import realtimeRestModel from 'can-realtime-rest-model'; or use dynamic import.
Add identity: true to the id property in your DefineMap definition.
Wrap in an options object: realtimeRestModel({ Map: MyMap, url: ... })