Remote / foldkit-remote/persistence

SavedList

interface · packages/remote/src/persistence.ts:48

interface SavedList {
  readonly segments: ReadonlyArray<ReadonlyArray<Edge>>
  readonly receivedAt: number
}

A list kept across a reload: its edges, and its age.

Members

SavedList.segments

property · packages/remote/src/persistence.ts:58

readonly segments: ReadonlyArray<ReadonlyArray<Edge>>

Its segments, each a run of edges. No boundaries.

Segments rather than one flat list, because the gaps between them are knowledge too. A connection paged from both ends holds a head and a tail with an unfetched middle; flattening those into one run would claim the tail's first row follows the head's last, which is a thing the client was never told.

SavedList.receivedAt

property · packages/remote/src/persistence.ts:60

readonly receivedAt: number

When the page that last answered it whole arrived; a restore keeps it, so its age goes on.