Skip to content

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
Contributor

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