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

Make updateHass not async #4060

Merged
merged 2 commits into from
Oct 19, 2019
Merged

Make updateHass not async #4060

merged 2 commits into from
Oct 19, 2019

Conversation

balloob
Copy link
Member

@balloob balloob commented Oct 19, 2019

So there is no comment here on why _updateHass is async. I tried going through the GitHub blame but couldn't find it. So I decided to remove it and it all works fine, so that's good.

If we merge this, let's keep an eye on issues that could be related. Generally I think that this should be better as now you could use this.hass right after updating Hass and it should represent the latest, and greatest, state.

@balloob
Copy link
Member Author

balloob commented Oct 19, 2019

I remember again why it is async. By making it async, it will be executed after the current code block. So if a single code block makes two changes, hassChanged won't be called out of order. Although looking at the mixins, we only use it for url-sync and it has no side effects, so it should be ok 🤔

@bramkragten bramkragten merged commit bbc3e7d into dev Oct 19, 2019
@delete-merged-branch delete-merged-branch bot deleted the maybe-faster branch October 19, 2019 15:19
@bramkragten bramkragten mentioned this pull request Oct 23, 2019
@github-actions github-actions bot locked and limited conversation to collaborators Jul 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants