Need to delete table record on xblock delete from studio


I have a requirement to run some operations when an XBlock is deleted via the studio. Is there any standard xblock api that enables users to define behavior on delete.
It would be better if the api is called on publish.

Thank you in advance for your help.