Skip to content

Commit

Permalink
fix: memory leak when useing in ssr (#235)
Browse files Browse the repository at this point in the history
Co-authored-by: lijingfeng <[email protected]>
  • Loading branch information
CjLaunch and lijingfeng authored Dec 10, 2024
1 parent 9c95199 commit 5973e83
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/core/utils/listener.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ const subscriber = (listenerType: ListenerType, event: EventFunc) => {
}

if (listeners.has(event)) return;
listeners.add(event);
if (!isServer) {
listeners.add(event);
}
return () => {
listeners.delete(event);
};
Expand Down

0 comments on commit 5973e83

Please sign in to comment.