Create a timer that belongs to the window. Timer will be automatically destroyed(cleared) when closed.
const window = useWindow();
window.setTimeout(() => {
window.close();
}, 1000);
window.setTimeout(() => {
// This won't be executed!
window.maximize();
}, 5000);