Skip to Content
⚠️Active Development Notice: TimeTiles is under active development. Information may be placeholder content or not up-to-date.

web


web / lib/collections/shared-hooks

lib/collections/shared-hooks

Shared collection hook factories.

Functions

createEnforceSingleDefault()

createEnforceSingleDefault<T>(options): BeforeChangeHook<T>

Creates a beforeChange hook that enforces at most one document with isDefault: true (optionally scoped by a parent relation).

Used by both Sites (global scope) and Views (scoped to site).

Type Parameters

T

T extends TypeWithID = TypeWithID

Parameters

options

SingleDefaultOptions

Returns

BeforeChangeHook<T>

Last updated on