-
Notifications
You must be signed in to change notification settings - Fork 778
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
[WIP] Core: Connected to #1434: add some
method.
#1435
Conversation
let focused = false; | ||
let someFocused = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternatively:
const FOCUSED_ONLY = "only";
const FOCUSED_SOME = "some";
const FOCUSED_NONE = "none";
let focused = FOCUSED_NONE;
function isFocused() {
return [FOCUSED_ONLY, FOCUSED_SOME].includes(focused);
}
then (when needed) we can simply check focused === FOCUSED_SOME
etc...
if ( focused || someFocused ) { | ||
return; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternatively (same below):
if (isFocused()) {
return;
}
if ( focused ) { | ||
return; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternatively:
if (focused === FOCUSED_ONLY) {
return;
}
if ( !someFocused ) { | ||
config.queue.length = 0; | ||
someFocused = true; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternatively:
if (focused === FOCUSED_NONE) {
config.queue.length = 0;
focused = FOCUSED_SOME;
}
Closing in favor of: #1436. |
WIP implementation of #1434.
TODO: