mirror of
https://github.com/strapi/strapi.git
synced 2025-09-21 14:31:16 +00:00
Apply unsubscribe feedback
This commit is contained in:
parent
c28f0d7cd8
commit
dc7cd643f0
@ -12,13 +12,19 @@ const createAuditLogsService = (strapi) => {
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
register() {
|
register() {
|
||||||
this.unsubscribe = strapi.eventHub.subscribe(saveEvent);
|
this._eventHubUnsubscribe = strapi.eventHub.subscribe(saveEvent);
|
||||||
|
return this;
|
||||||
|
},
|
||||||
|
|
||||||
|
unsubscribe() {
|
||||||
|
if (this._eventHubUnsubscribe) {
|
||||||
|
this._eventHubUnsubscribe();
|
||||||
|
}
|
||||||
|
return this;
|
||||||
},
|
},
|
||||||
|
|
||||||
destroy() {
|
destroy() {
|
||||||
if (this.unsubscribe) {
|
return this.unsubscribe();
|
||||||
this.unsubscribe();
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user