TypeScript API / @laikacms/astro/live / liveDocumentsLoader
Function: liveDocumentsLoader()
Call Signature
function liveDocumentsLoader<K>(options): LiveLoader<LiveCollectionData<K>, LaikaEntryFilter, LaikaCollectionFilter, LaikaError<ErrorCode, number>>;A live loader over a Laika DocumentsRepository.
When collection names a collection the integration has typed (see live-collections.ts), entry.data comes back as that collection's shape. Otherwise — an untyped collection, or collection omitted so the key is only known at runtime — it stays Record<string, unknown>.
Type Parameters
| Type Parameter |
|---|
K extends "posts" |
Parameters
| Parameter | Type |
|---|---|
options | LiveDocumentsLoaderOptions & object |
Returns
LiveLoader<LiveCollectionData<K>, LaikaEntryFilter, LaikaCollectionFilter, LaikaError<ErrorCode, number>>
Call Signature
function liveDocumentsLoader(options): LiveLoader<Record<string, unknown>, LaikaEntryFilter, LaikaCollectionFilter, LaikaError<ErrorCode, number>>;A live loader over a Laika DocumentsRepository.
When collection names a collection the integration has typed (see live-collections.ts), entry.data comes back as that collection's shape. Otherwise — an untyped collection, or collection omitted so the key is only known at runtime — it stays Record<string, unknown>.
Parameters
| Parameter | Type |
|---|---|
options | LiveDocumentsLoaderOptions |
Returns
LiveLoader<Record<string, unknown>, LaikaEntryFilter, LaikaCollectionFilter, LaikaError<ErrorCode, number>>