Skip to content

Commit 904fb11

Browse files
Add unrendered event when disconnecting
1 parent 43b9a77 commit 904fb11

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/oc-client.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -704,6 +704,13 @@ export function createOc(oc) {
704704
disconnectedCallback() {
705705
if (this.#connected) {
706706
this.#connected = false;
707+
const id = this.getAttribute("id");
708+
if (id) {
709+
oc.events.fire("oc:unrendered", {
710+
element: this,
711+
id,
712+
});
713+
}
707714
const shouldUnmount =
708715
this.#manageLifecycle &&
709716
this.unmount &&

0 commit comments

Comments
 (0)