Skip to content

core: move network recorder and monitor to EventEmitter #14152

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 1 commit into from
Jun 23, 2022

Conversation

brendankenny
Copy link
Contributor

Part of #14078

Like with session in #14147, moves NetworkRecorder and NetworkMonitor from having event emitters to being event emitters.

Normally composition is 🥇, but in this case it was just requiring us to declare delegation methods to have equivalent functionality. Technically inheritance now, but functionality is disjoint, so let's just call it a mixin still :)

No functionality or test changes.

* @typedef {{
* requeststarted: [NetworkRequest],
* requestfinished: [NetworkRequest],
* }} NetworkRecorderEventMap
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: can this be done with a proper multiline typdef?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could be, but the main benefit of the @property form is you can document the properties. This won't ever be used as the type for a real object, the properties are for type lookup by event name, so there wouldn't ever be anywhere those jsdoc strings would show up

@brendankenny brendankenny merged commit 28ab5c2 into master Jun 23, 2022
@brendankenny brendankenny deleted the network-emitter branch June 23, 2022 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants