Skip to content

Search the guides, deployment pages, and API reference.

LiveLoader

import type { LiveLoader } from "@pitlane/content";

A loader that answers one query at a time.

There is no store to fill and so nothing to serialize: the only way to get entries out of it is to ask, which means asking on every read.

Type Parameters

Data

Data = Record<string, unknown>

Properties

name

name: string;

Methods

loadCollection()

loadCollection(): Promise<LiveEntry<Data>[]>;

Every entry the source holds, unvalidated; called on every getCollection.

Returns

Promise<LiveEntry<Data>[]>


loadEntry()

loadEntry(id): Promise<
| LiveEntry<Data>
| undefined>;

The entry with this id, or undefined when the source has none; called on every getEntry.

Parameters

id

string

Returns

Promise< | LiveEntry<Data> | undefined>