Skip to main content
A live source pushes row patches to the grid while it is open. A patch upserts rows by key and deletes rows by key. The grid merges it into the rows it loaded without a reload.

Row patches

Upserted rows replace the loaded row with the same key. New rows are added. Without a group, the merged rows are placed in the order of the current sort.

From an array

createArraySource returns a source with patch(patch). It updates the source’s rows and broadcasts the patch to every subscribed grid.
patch.ts

From your own transport

A source is live when it has subscribe(onPatch). The grid subscribes on its first load and calls the returned function when it is disposed. Set live: true in the capabilities so servers and tools know it.
with-socket.ts
rowPatchSchema from tally-protocol validates a patch that crossed the network.

Which sources are live

Over HTTP

tally-server writes each patch as an event: patch message on GET /events and sends a keep-alive comment every heartbeatMs, 15 seconds by default. connectHttpSource opens the stream with the same headers as every request and closes it when the grid is disposed.
The stream reconnects on its own, but events carry no id. Patches sent while a client is disconnected are not replayed. A stream whose client falls more than 1024 events behind is closed by the server.
Patch events that do not match the protocol schema are dropped on the client.

Changed cells

The row store records which columns a patch changed for each row. useRows(grid).changed maps a row key to those column ids, and in filters the grid runs itself, the is:changed flag matches those rows.
changed-count.tsx
See Data sources and protocol for the full source contract.