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