---
title: "LiveLoader"
description: "A loader that answers one query at a time."
url: "https://pitlane.tools/package/content/interface/LiveLoader"
---

# LiveLoader

```ts
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

```ts
name: string;
```

## Methods

### loadCollection()

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

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

#### Returns

`Promise`\<[`LiveEntry`](https://pitlane.tools/package/content/interface/LiveEntry.md)\<`Data`>\[\]>

---

### loadEntry()

```ts
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`](https://pitlane.tools/package/content/interface/LiveEntry.md)\<`Data`> | `undefined`>
