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

[WIP] Core: Connected to #1434: add some method. #1435

Closed
wants to merge 2 commits into from

Conversation

ventuno
Copy link
Member

@ventuno ventuno commented Apr 17, 2020

WIP implementation of #1434.

TODO:

  • docs;

@jsf-clabot
Copy link

jsf-clabot commented Apr 17, 2020

CLA assistant check
All committers have signed the CLA.

Comment on lines 26 to +27
let focused = false;
let someFocused = false;
Copy link
Member Author

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...

Comment on lines +681 to 683
if ( focused || someFocused ) {
return;
}
Copy link
Member Author

@ventuno ventuno Apr 17, 2020

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;
}

Comment on lines +740 to +742
if ( focused ) {
return;
}
Copy link
Member Author

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;
}

Comment on lines +744 to +747
if ( !someFocused ) {
config.queue.length = 0;
someFocused = true;
}
Copy link
Member Author

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;
}

@ventuno
Copy link
Member Author

ventuno commented Apr 30, 2020

Closing in favor of: #1436.

@ventuno ventuno closed this Apr 30, 2020
@ventuno ventuno deleted the ftr-1434 branch April 30, 2020 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants