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

Support the once option, when registering EventBus listeners #12793

Merged
merged 1 commit into from
Dec 30, 2020

Conversation

Snuffleupagus
Copy link
Collaborator

This follows the same principle as the once option that exists in the native addEventListener method, and will thus automatically remove an EventBus listener when it's invoked; see https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Parameters

Finally, this patch also tweaks some the existing EventBus-code to use modern features such as optional chaining and logical assignment operators.

This follows the same principle as the `once` option that exists in the native `addEventListener` method, and will thus automatically remove an `EventBus` listener when it's invoked; see https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Parameters

Finally, this patch also tweaks some the existing `EventBus`-code to use modern features such as optional chaining and logical assignment operators.
@Snuffleupagus
Copy link
Collaborator Author

/botio unittest

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

Command cmd_unittest from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.67.70.0:8877/bd858519073a7ee/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Success

Full output at http://54.67.70.0:8877/bd858519073a7ee/output.txt

Total script time: 3.64 mins

  • Unit Tests: Passed

@timvandermeij
Copy link
Contributor

/botio-linux preview

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

Command cmd_preview from @timvandermeij received. Current queue size: 0

Live output at: http://54.67.70.0:8877/b011a9c089aad7e/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Success

Full output at http://54.67.70.0:8877/b011a9c089aad7e/output.txt

Total script time: 4.19 mins

Published

@timvandermeij timvandermeij merged commit 57bec09 into mozilla:master Dec 30, 2020
@timvandermeij
Copy link
Contributor

Looks good; thanks!

@Snuffleupagus Snuffleupagus deleted the Eventbus-once branch December 30, 2020 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants