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

Reduce useless render calls in 'closable()' mixin #192

Merged
merged 2 commits into from
Nov 29, 2018

Conversation

zhusee2
Copy link
Contributor

@zhusee2 zhusee2 commented Nov 28, 2018

Summary

clickedInside and closeDelayTimeout are only used inside internal event listeners to determine if an outside-click event can be ignored when an inside-click event has already scheduled a close callback.

They were previously put inside component states, therefore triggers useless render() calls as they change while they never affect render results.

Moving them to instance variables saves a few calls to render().

`clickedInside` and `closeDelayTimeout` are only used inside internal
event listeners to determine if an outside-click event can be ignored
if an inside-click event has already scheduled a close callback.

They were previously put inside component states, therefore triggers
useless `render()` calls as they change while they never affect render
results.

Moving them to instance variables saves a few calls to `render()`.
@zhusee2 zhusee2 changed the title Reduce useless render calls in 'closable() Reduce useless render calls in 'closable()' mixin Nov 28, 2018
@zhusee2 zhusee2 changed the base branch from develop to release/2.0.0 November 28, 2018 09:16
@zhusee2 zhusee2 requested a review from hsunpei November 28, 2018 09:17
@zhusee2 zhusee2 self-assigned this Nov 28, 2018
@zhusee2 zhusee2 added this to the Version 2 milestone Nov 28, 2018
@zhusee2 zhusee2 mentioned this pull request Nov 28, 2018
Copy link
Contributor

@hsunpei hsunpei left a comment

Choose a reason for hiding this comment

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

LGTM 🥇 🚢

@zhusee2 zhusee2 merged commit 99c46b6 into release/2.0.0 Nov 29, 2018
@zhusee2 zhusee2 deleted the feature/reduce_useless_render_closable branch November 29, 2018 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants