Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add event bus #1693

Merged
merged 13 commits into from
Apr 25, 2023
Merged

feat: add event bus #1693

merged 13 commits into from
Apr 25, 2023

Conversation

achingbrain
Copy link
Member

@achingbrain achingbrain commented Apr 16, 2023

Adds an event emitter as a libp2p component that will echo every emitted event on the main libp2p object.

Closes #1574
Fixes #1630

Adds an event emitter as a libp2p component that will echo every
emitted event on the main libp2p object.

Fixes #1574
achingbrain added a commit to libp2p/js-libp2p-interfaces that referenced this pull request Apr 16, 2023
achingbrain added a commit to libp2p/js-libp2p-interfaces that referenced this pull request Apr 21, 2023
Removes events from some internal components and adds them to the event bus.

Decouples internal components from each other since they can listen to the bus for events rather than having to know about the component that dispatches them.

Refs: libp2p/js-libp2p#1693
@achingbrain achingbrain marked this pull request as ready for review April 25, 2023 08:36
@achingbrain
Copy link
Member Author

achingbrain commented Apr 25, 2023

Going to merge this to unblock #1563 - will address any PR comments in a follow up before 0.45.x is shipped.

@achingbrain achingbrain merged commit 17eb162 into master Apr 25, 2023
@achingbrain achingbrain deleted the feat/add-event-bus branch April 25, 2023 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: heliaInstance.libp2p.addEventListener('peer:discovery', cb) calls cb twice for same peer libp2p events
1 participant