Skip to content

Move all event handling to PortalNetwork class #793

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

Merged
merged 3 commits into from
May 21, 2025
Merged

Move all event handling to PortalNetwork class #793

merged 3 commits into from
May 21, 2025

Conversation

ScottyPoi
Copy link
Collaborator

his PR removes direct EventEmitter inheritance from Network classes and restructurs how events are handled across the Portal Network implementation.
The changes introduce namespaced events and centralize event handling through the PortalNetwork class

Changes

  • Remove EventEmitter inheritance from Network classes

  • Implement namespaced events using network IDs (e.g., ${networkId}:ContentAdded)

  • Move event handling from Network classes to PortalNetwork class

  • Update event listeners and emitters across all network implementations

  • Update tests

  • BaseNetwork classes

    • Removed EventEmitter inheritance
    • Events now emitted through this.portal instead of directly
    • Event names prefixed with network IDs for better isolation
  • Event Handling

    • All events are now namespaced with their network ID
    • Removed redundant network ID checks in event handlers

@ScottyPoi ScottyPoi merged commit 76d287f into master May 21, 2025
4 checks passed
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.

1 participant