# RangeSource (@salmonui/data)

> The RangeSource interface of @salmonui/data.

Canonical: https://salmonui.dev/docs/reference/data/RangeSource

```ts
import type { RangeSource } from '@salmonui/data';
```

Entry index: https://salmonui.dev/docs/reference/data (Markdown with every symbol of the entry: https://salmonui.dev/docs/reference/data.md).

## Reference

Kind: interface

```ts
interface RangeSource<T> {
    getSnapshot(): RangeSourceSnapshot<T>;
    subscribe(listener: () => void): () => void;
    request(range: Range): void;
    invalidate(): void;
}
```

Members (4):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `getSnapshot` | `getSnapshot(): RangeSourceSnapshot<T>;` |  |  |
| `subscribe` | `subscribe(listener: () => void): () => void;` |  |  |
| `request` | `request(range: Range): void;` |  | Shows `range`: served from a cached range that covers it, else loaded (the previous load is aborted). |
| `invalidate` | `invalidate(): void;` |  | Drops the cache (for example after the data changed on the server). |
