-
Notifications
You must be signed in to change notification settings - Fork 10k
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
Shorten the code in the web/text_layer_builder.js
file
#18152
Shorten the code in the web/text_layer_builder.js
file
#18152
Conversation
- Use `this` rather than explicitly spelling out the class-name in the static `#enableGlobalSelectionListener` method, since that leads to shorter code. Given that all the relevant static fields are *private* ESLint will catch any scope errors in the code. - Reduce a little bit of duplication when using the `#selectionChangeAbortController` signal. - Utilize early returns in the "selectionchange" event handler, since that reduces overall indentation which helps readability a tiny bit.
/botio integrationtest |
From: Bot.io (Linux m4)ReceivedCommand cmd_integrationtest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.241.84.105:8877/3a191dc982f3085/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_integrationtest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.193.163.58:8877/105c40f1452217f/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/3a191dc982f3085/output.txt Total script time: 7.47 mins
|
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/105c40f1452217f/output.txt Total script time: 18.45 mins
|
/botio-linux preview |
From: Bot.io (Linux m4)ReceivedCommand cmd_preview from @timvandermeij received. Current queue size: 0 Live output at: http://54.241.84.105:8877/629ea1f855ca782/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/629ea1f855ca782/output.txt Total script time: 1.17 mins Published |
Thanks! |
Use
this
rather than explicitly spelling out the class-name in the static#enableGlobalSelectionListener
method, since that leads to shorter code. Given that all the relevant static fields are private ESLint will catch any scope errors in the code.Reduce a little bit of duplication when using the
#selectionChangeAbortController
signal.Utilize early returns in the "selectionchange" event handler, since that reduces overall indentation which helps readability a tiny bit.