Skip to content

Commit 8a03909

Browse files
committed
fix: cleanup listener
1 parent b09e1e9 commit 8a03909

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

packages/bundler-metro/src/factory.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,10 @@ const waitForBundler = async (
2626
};
2727
reporter.addListener(onEvent);
2828

29-
abortSignal.addEventListener('abort', () =>
30-
reject(new DOMException('The operation was aborted', 'AbortError'))
31-
);
29+
abortSignal.addEventListener('abort', () => {
30+
reporter.removeListener(onEvent);
31+
reject(new DOMException('The operation was aborted', 'AbortError'));
32+
});
3233
});
3334
};
3435

0 commit comments

Comments
 (0)