<script lang="ts">
  import { onMount } from "svelte";
  import markStale from "../stores/markStale";

  function handleFocus() {
    markStale("*");
  }

  onMount(() => {
    window.addEventListener("focus", handleFocus);

    return () => {
      window.removeEventListener("focus", handleFocus);
    }
  })
</script>