Handle hot module unloading in layout

This commit is contained in:
Jon Staab
2025-10-21 08:27:30 -07:00
parent 7476767aa7
commit ecbb3086d8
8 changed files with 262 additions and 285 deletions
+6 -2
View File
@@ -1,5 +1,6 @@
import {
always,
call,
on,
hash,
last,
@@ -281,8 +282,8 @@ const syncWrapManager = async () => {
}
}
export const syncDataStores = () =>
Promise.all([
export const syncDataStores = async () => {
const unsubscribers = await Promise.all([
syncEvents(),
syncTracker(),
syncRelays(),
@@ -292,3 +293,6 @@ export const syncDataStores = () =>
syncPlaintext(),
syncWrapManager(),
])
return () => unsubscribers.forEach(call)
}