MCPcopy Create free account
hub / github.com/Qinbf/groundmap / onNav

Function onNav

web/components/ScrollMemory.tsx:186–189  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

184 // 内容 commit 后运行,时序正确,且 <main> 可能换成另一棵子树的新节点)。
185 useEffect(() => {
186 const onNav = () => {
187 if (currentHref() !== decidedHrefRef.current) return;
188 runDecisionRef.current();
189 };
190 window.addEventListener("popstate", onNav);
191 window.addEventListener("hashchange", onNav);
192 return () => {

Callers

nothing calls this directly

Calls 1

currentHrefFunction · 0.85

Tested by

no test coverage detected