globalAfterChangeHook
globalAfterChangeHook<
TGlobalSlug,TDataModel>(slug,fn): (<TDataModel>(props) =>void|Promise<void>) |undefined
Defined in: packages/core/src/globals/hooks.ts:91
Types a global’s afterChange hook against a real global and
DataModel. Mirrors afterChangeHook (collections/hooks.ts).
Type Parameters
Section titled “Type Parameters”TGlobalSlug
Section titled “TGlobalSlug”TGlobalSlug extends string
TDataModel
Section titled “TDataModel”TDataModel extends GenericDataModel = GenericDataModel
Parameters
Section titled “Parameters”TGlobalSlug
The global slug constant.
(props) => void | Promise<void>
The hook function, checked against the real types.
Returns
Section titled “Returns”(<TDataModel>(props) => void | Promise<void>) | undefined
The same function, re-typed to the global’s hooks.afterChange signature.