Realtime
Live views, presence, comments, and record locks.
Provider builders & transports
Publishes an event after each successful create, update, delete, updateMany or deleteMany so other clients refresh. The write never fails because a publish failed.
Routes realtime events by topic inside one process, with no server and no library. For tests and demos: it reaches one page, not another browser.
Carries realtime events between the tabs of one browser through a BroadcastChannel. No server and no socket to reconnect, and no reach past that browser.
Carries realtime events over one WebSocket and reconnects with backoff. Needs a server that answers Chelone's frames.
Reads realtime events from a server-sent events stream and publishes with a POST. Needs a stream endpoint, and a publish endpoint to publish to.
A LockProvider kept in a Map, for tests and demos. Locks do not outlive the page and never reach another browser.
Live views & menus
A <List> that refreshes when records in its resource change or the connection returns. Takes the same props as <List> and needs a realtime data provider.
An <Edit> that refreshes the record on changes and reconnects. Holds incoming changes while the form has unsaved edits, then refetches once it is saved or reset. Needs a realtime data provider.
A <Show> that refreshes the record on changes and reconnects. Takes the same props as <Show> and needs a realtime data provider.
A navigation menu whose links show unread event counts for their resources. Counts new records by default and clears a link's count while its route is open. Needs a realtime data provider.
Collaboration
Shows avatars for other users viewing the same record, with a count for those beyond maxAvatars. Renders nothing when nobody else is present. Needs a realtime data provider.
Lists a record's comments and provides a box to post one through the data provider. resolvable adds a button to mark a comment resolved. Refreshes on comment events when the provider supports realtime.
Record locks
Acquires a record lock while mounted and releases it on unmount. Shows its children once the lock is held, a loading placeholder while requesting it, or the holder when another identity has it. Needs a realtime data provider with lock support.
Shows a badge naming the record's lock holder and updates when the lock is taken or released. Renders nothing for a free record unless renderFree is supplied. Needs a realtime data provider with lock support.
Subscribe & publish hooks
Listens to one topic while the component is mounted and calls your callback for each event on it. A new callback every render never resubscribes. Needs a realtime data provider.
useSubscribe for one record's topic. Subscribes to nothing while the id is null or undefined, and 0 is an id.
useSubscribe for a whole resource's topic: creates, and the ids of every update, delete, updateMany and deleteMany.
Returns subscribe(topic, callback) over the data provider, for subscriptions you start yourself. It hands back the unsubscribe, and you own it.
Returns publish(topic, event) over the data provider, for the events your own app invents. Resolves when the transport's publish settles.
Calls your callback each time the transport reconnects, for refetching what was missed while offline. Does nothing when the transport cannot say.
The connection status and the last transport error, following the transport while the component is mounted. status is idle when the transport reports neither.
Live read hooks
useGetList, kept fresh: refetches when anything in its resource changes or the connection returns. Needs a realtime data provider.
useGetOne, kept fresh: refetches when its record changes or the connection returns. Needs a realtime data provider.
useGetMany, kept fresh: refetches when any listed record changes or the connection returns. Needs a realtime data provider.
Lock hooks
Takes a record's lock for an identity. Returns a lock function, its pending state and its last error; rejects with LockConflictError when another identity holds the record.
Releases a record's lock for the identity that holds it. Returns an unlock function, its pending state and its last error.
Reads one record's lock, or null when the record is free. Subscribes to nothing; use useGetLockLive to stay current.
useGetLock, kept fresh: refetches when the record's lock is taken or released, or the connection returns. Needs a realtime data provider with lock support.
Reads every lock held on a resource as an array, empty when none are held. Subscribes to nothing; use useGetLocksLive to stay current.
useGetLocks, kept fresh: refetches when any lock of the resource is taken or released, or the connection returns. Needs a realtime data provider with lock support.
Holds a record's lock while the component is mounted and reports the lock, whether a request is in flight, and the last lock failure. A failed release reaches onLockError only. Needs a realtime data provider with lock support.