Skip to content

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).

TGlobalSlug extends string

TDataModel extends GenericDataModel = GenericDataModel

TGlobalSlug

The global slug constant.

(props) => void | Promise<void>

The hook function, checked against the real types.

(<TDataModel>(props) => void | Promise<void>) | undefined

The same function, re-typed to the global’s hooks.afterChange signature.