From e98d97a271857efe14e6f15d8971d452b2d1a2d5 Mon Sep 17 00:00:00 2001
From: Felix Nie <hongtuo.nie@u.nus.edu>
Date: Wed, 07 May 2025 19:56:18 +0000
Subject: [PATCH] feat(i18n): readermode translations and icon (#1961)

---
 docs/advanced/creating components.md |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/docs/advanced/creating components.md b/docs/advanced/creating components.md
index 628d5aa..369405b 100644
--- a/docs/advanced/creating components.md
+++ b/docs/advanced/creating components.md
@@ -161,6 +161,18 @@
 })
 ```
 
+You can also add the equivalent of a `beforeunload` event for [[SPA Routing]] via the `prenav` event.
+
+```ts
+document.addEventListener("prenav", () => {
+  // executed after an SPA navigation is triggered but
+  // before the page is replaced
+  // one usage pattern is to store things in sessionStorage
+  // in the prenav and then conditionally load then in the consequent
+  // nav
+})
+```
+
 It is best practice to track any event handlers via `window.addCleanup` to prevent memory leaks.
 This will get called on page navigation.
 

--
Gitblit v1.10.0