Remote / foldkit-remote-server

MemoryStore

interface · packages/remote-server/src/index.ts:843

interface MemoryStore {
  readonly rows: (
    entity: string,
  ) => ReadonlyArray<Readonly<Record<string, unknown>>>
  readonly write: (
    entity: string,
    id: string,
    values: Readonly<Record<string, unknown>>,
  ) => void
  readonly remove: (entity: string, id: string) => void
}

The rows a memory backend holds, which its mutations write through. A change is what the next read sees; nothing is pushed to a client.

Members

MemoryStore.rows

property · packages/remote-server/src/index.ts:845

readonly rows: (
  entity: string,
) => ReadonlyArray<Readonly<Record<string, unknown>>>

The rows of one entity, in insertion order.

MemoryStore.write

property · packages/remote-server/src/index.ts:847

readonly write: (
  entity: string,
  id: string,
  values: Readonly<Record<string, unknown>>,
) => void

Writes these values onto a row, creating it if it is new.

MemoryStore.remove

property · packages/remote-server/src/index.ts:848

readonly remove: (entity: string, id: string) => void