If I subscribe to window.onresize (in a single page app), do I need to unsubscribe to avoid a memory leak? If so, how do I do that?

```
<script type="text/javascript">
  var heightOutput = document.querySelector('#height');
  var widthOutput = document.querySelector('#width');

  function resize() { 
    heightOutput.textContent = window.innerHeight;
    widthOutput.textContent = window.innerWidth;
  }

  window.onresize = resize;
</script>

```

<https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers/onresize>