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

refactor: Replace EventEmitter with EventTarget#63

Open
saul-jb wants to merge 10 commits intoorbitdb-archive:mainfrom
saul-jb:refactor/events
Open

refactor: Replace EventEmitter with EventTarget#63
saul-jb wants to merge 10 commits intoorbitdb-archive:mainfrom
saul-jb:refactor/events

Conversation

@saul-jb
Copy link
Copy Markdown

@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