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

chore(waitForEvent): refactor waitForEvent into a single implementation #1602

Merged
merged 2 commits into from
Mar 31, 2020

Conversation

JoelEinbinder
Copy link
Contributor

Moves the waitForEvent implementation into an ExtendedEventEmitter class.

This is step one if we want to add waitForEvent to Worker, Browser, and BrowserServer objects. All of these only have a 'close' event, but I still feel we should be consistent with our event emitters.

src/page.ts Outdated
@@ -111,7 +112,10 @@ export class Page extends platform.EventEmitter {
_ownedContext: BrowserContext | undefined;

constructor(delegate: PageDelegate, browserContext: BrowserContextBase) {
super();
super({
Copy link
Contributor

Choose a reason for hiding this comment

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

Since we already inherit, perhaps use overridden methods instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure.

src/extendedEventEmitter.ts Show resolved Hide resolved
@JoelEinbinder JoelEinbinder merged commit 9e85f8d into microsoft:master Mar 31, 2020
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.

2 participants