afterChangeHook
afterChangeHook<
TCollectionSlug,TDataModel>(slug,fn): (<TDataModel>(props) =>void|Promise<void>) |undefined
Defined in: packages/core/src/collections/hooks.ts:167
Types a collection’s afterChange hook against a real collection,
DataModel, and resolved CollectionConfig.
Type Parameters
Section titled “Type Parameters”TCollectionSlug
Section titled “TCollectionSlug”TCollectionSlug extends string
TDataModel
Section titled “TDataModel”TDataModel extends GenericDataModel = GenericDataModel
Parameters
Section titled “Parameters”TCollectionSlug
The collection slug docs/collection should be typed as.
(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 collection’s loose public hooks.afterChange signature.