Skip to content

Commit 0cbceb6

Browse files
committed
fix: 🐛 cache
1 parent 2aa49cd commit 0cbceb6

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

packages/website/lib/iframe-sync.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,13 @@ export const syncPathToParent = (iframe: HTMLIFrameElement, to: string) => {
99
}, '*')
1010
}
1111

12-
const cache = {
13-
prevPath: ''
14-
}
1512
/**
1613
* 监听子路由的变化
1714
* @param callback
1815
* @returns
1916
*/
2017
export const onPathchange = (callback?: (path: string) => void): () => void => {
18+
const cache = { prevPath: '' }
2119
const handleMessage = (e: { data: { value: string } }) => {
2220
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
2321
// @ts-ignore

0 commit comments

Comments
 (0)