Skip to content

Commit 4dfce75

Browse files
authored
Merge pull request #145 from sirajulm/add-unmount-event
Adding unmount event for nova bridge
2 parents a1b3ee8 + 1142c8c commit 4dfce75

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

src/Nova.jsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,17 @@ class Nova extends Component {
2929
}
3030
}
3131

32+
componentWillUnmount() {
33+
if (window !== 'undefined') {
34+
const id = this.placeholder.current.getAttribute("data-hypernova-id");
35+
const { name } = this.props;
36+
const customEvent = new CustomEvent('NovaUnmount', {
37+
detail: { id, name },
38+
});
39+
document.dispatchEvent(customEvent);
40+
}
41+
}
42+
3243
render() {
3344
const { name, data } = this.props;
3445
return (

0 commit comments

Comments
 (0)