Skip to content

Commit 31f3999

Browse files
committed
fix a memory leak in the scheduler
1 parent e6d9c36 commit 31f3999

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/scheduler.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export function batch (fn, ctx, args) {
1515
// this creates and returns a batched version of the passed function
1616
// the cache is necessary to always map the same thing to the same function
1717
// which makes sure that addEventListener/removeEventListener pairs don't break
18-
const cache = new Map()
18+
const cache = new WeakMap()
1919
function batchFn (fn) {
2020
if (typeof fn !== 'function') {
2121
return fn

0 commit comments

Comments
 (0)