Skip to content

defineSync

function defineSync<C>(sync: (ctx: SourceContext<C>) => Promise<
| SourceSyncResult
| Document[]>): TroveSource<C>;

A source authored inline as a single sync function.

Type ParameterDefault typeDescription
CRecord<string, unknown>The shape of the source’s typed ctx.config preferences.
ParameterTypeDescription
sync(ctx: SourceContext<C>) => Promise< | SourceSyncResult | Document[]>The source’s sync(ctx) implementation.

TroveSource<C>

A TroveSource wrapping sync. No manifest, so not deployable on its own — this is the shape a test or a local experiment uses.