Skip to content

GlobalHooksInput

Defined in: packages/core/src/globals/hooks.ts:50

Lifecycle hooks for a global. beforeChange runs inline in the write path (prepareEdit) and may reject by throwing. afterChange runs via convex-helpers triggers after the write commits, through the builder returned by createVexMutations — never for writes made through the raw _generated/server builder, the dashboard, or npx convex import.

TGlobalSlug extends GlobalSlug = GlobalSlug

optional afterChange<TDataModel>(props): void | Promise<void>

Defined in: packages/core/src/globals/hooks.ts:54

TDataModel extends GenericDataModel = GenericDataModel

GlobalAfterChangeProps<TGlobalSlug, TDataModel>

void | Promise<void>


optional beforeChange<TDataModel>(props): DocumentByGlobalSlug<TGlobalSlug> | Promise<DocumentByGlobalSlug<TGlobalSlug>>

Defined in: packages/core/src/globals/hooks.ts:51

TDataModel extends GenericDataModel = GenericDataModel

GlobalBeforeChangeProps<TGlobalSlug, TDataModel>

DocumentByGlobalSlug<TGlobalSlug> | Promise<DocumentByGlobalSlug<TGlobalSlug>>