Skip to content
This repository has been archived by the owner on Oct 5, 2023. It is now read-only.

refactor: Replace EventEmitter with EventTarget #63

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

saul-jb
Copy link

@saul-jb saul-jb commented Apr 4, 2023

This PR replaces the NodeJS EventEmitter with the native EventTarget.

EventEmitter is not native to a browser environment whereas EventTarget is in both NodeJS and browser environments, this change will mean the EventEmitter does not need to somehow be bundled in to work with browser environments increasing native cross-environment compatibility.

This is how Libp2p, IPFS and related modules have an event system while maintaining browser compatibility.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant