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.
Type Parameters
Section titled “Type Parameters”TGlobalSlug
Section titled “TGlobalSlug”TGlobalSlug extends GlobalSlug = GlobalSlug
Methods
Section titled “Methods”afterChange()?
Section titled “afterChange()?”
optionalafterChange<TDataModel>(props):void|Promise<void>
Defined in: packages/core/src/globals/hooks.ts:54
Type Parameters
Section titled “Type Parameters”TDataModel
Section titled “TDataModel”TDataModel extends GenericDataModel = GenericDataModel
Parameters
Section titled “Parameters”GlobalAfterChangeProps<TGlobalSlug, TDataModel>
Returns
Section titled “Returns”void | Promise<void>
beforeChange()?
Section titled “beforeChange()?”
optionalbeforeChange<TDataModel>(props):DocumentByGlobalSlug<TGlobalSlug> |Promise<DocumentByGlobalSlug<TGlobalSlug>>
Defined in: packages/core/src/globals/hooks.ts:51
Type Parameters
Section titled “Type Parameters”TDataModel
Section titled “TDataModel”TDataModel extends GenericDataModel = GenericDataModel
Parameters
Section titled “Parameters”GlobalBeforeChangeProps<TGlobalSlug, TDataModel>
Returns
Section titled “Returns”DocumentByGlobalSlug<TGlobalSlug> | Promise<DocumentByGlobalSlug<TGlobalSlug>>