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

Fix menu bar update frequency #382

Merged
merged 1 commit into from
Oct 30, 2017
Merged

Fix menu bar update frequency #382

merged 1 commit into from
Oct 30, 2017

Conversation

sallar
Copy link
Member

@sallar sallar commented Oct 30, 2017

Fixes #373

@sallar sallar requested a review from perry-mitchell October 30, 2017 20:10
@@ -11,6 +12,9 @@ export function setupActions(store) {
// Clear update notice
store.dispatch(updateInstalled());

// Update the menu
store.subscribe(debounce(() => setupMenu(store), 500));
Copy link
Member

Choose a reason for hiding this comment

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

Why debounce menu creation? Isn't 500ms maybe a bit much?

Copy link
Member Author

Choose a reason for hiding this comment

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

Its not menu creation. Everytime the store updates (any action regardless of it having anything to do with menu or not) this re-draws the menu which is slightly heavy process. And sometimes this function (subcribed function) gets called 20 times in 100ms. So just wanted to avoid performance issues and lags

Copy link
Member

Choose a reason for hiding this comment

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

👍

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