Skip to main content

Interface: EntityCallbacks<M>

This interface defines all the callbacks that can be used when an entity is being created, updated or deleted. Useful for adding your own logic or blocking the execution of the operation.

Type parameters#

NameType
MM: Object = any

Methods#

onDelete#

Optional onDelete(entityDeleteProps): void

Callback used after the entity is deleted.

Parameters#

NameType
entityDeletePropsEntityOnDeleteProps<M>

Returns#

void

Defined in#

models/entity_callbacks.ts:49


onPreDelete#

Optional onPreDelete(entityDeleteProps): void

Callback used after the entity is deleted. If you throw an error in this method the process stops, and an error snackbar gets displayed.

Parameters#

NameType
entityDeletePropsEntityOnDeleteProps<M>

Returns#

void

Defined in#

models/entity_callbacks.ts:42


onPreSave#

Optional onPreSave(entitySaveProps): Partial<M> | Promise<Partial<M>>

Callback used before saving, you need to return the values that will get saved. If you throw an error in this method the process stops, and an error snackbar gets displayed.

Parameters#

NameType
entitySavePropsEntityOnSaveProps<M>

Returns#

Partial<M> | Promise<Partial<M>>

Defined in#

models/entity_callbacks.ts:32


onSaveFailure#

Optional onSaveFailure(entitySaveProps): void | Promise<void>

Callback used when saving fails

Parameters#

NameType
entitySavePropsEntityOnSaveProps<M>

Returns#

void | Promise<void>

Defined in#

models/entity_callbacks.ts:23


onSaveSuccess#

Optional onSaveSuccess(entitySaveProps): void | Promise<void>

Callback used when save is successful

Parameters#

NameType
entitySavePropsEntityOnSaveProps<M>

Returns#

void | Promise<void>

Defined in#

models/entity_callbacks.ts:16