# What is the proper use of domain.dispose? We are developing a co-editable web editor using convergence and AceEditor. So there is one question. We call `domain.dispose()` when closing the browser or doing page transition to release the domain resource. This is executed by the javascript unload event. However, there are occasions when the screen reloading does not execute `domain.dispose()` processing. As a result, domain resources are not released, and unnecessary cursors etc. remain on the screen. (In the beforeunload event, `event.preventDefault ()` is executed. [example](https://developer.mozilla.org/en-US/docs/Web/API/Window/beforeunload_event#Examples) So using the beforeunload event will not work, as `domain.dispose()` will be executed unintentionally.) Is there a good way to do `domain.dispose()` for sure? ### Source code ``` window.addEventListener("unload", () => { domain.dispose(); }); ``` Using Laravel 5.5 and Vue 2.5