0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-02-17 22:44:24 -05:00

Update packages/astro/src/runtime/client/events.ts

Co-authored-by: Matthew Phillips <matthew@skypack.dev>
This commit is contained in:
Nate Moore 2022-05-27 13:35:32 -05:00 committed by Nate Moore
parent 001731d224
commit 0a785629ea

View file

@ -18,7 +18,7 @@ export const listen = (cb: (...args: any[]) => any) => window.addEventListener(H
if (!(window as any)[HYDRATE_KEY]) {
if ('MutationObserver' in window) {
new MutationObserver(() => notify()).observe(document.body, { subtree: true, childList: true });
new MutationObserver(notify).observe(document.body, { subtree: true, childList: true });
}
(window as any)[HYDRATE_KEY] = true;
}