Skip to content

Make updateHass not async#4060

Merged
bramkragten merged 2 commits into
devfrom
maybe-faster
Oct 19, 2019
Merged

Make updateHass not async#4060
bramkragten merged 2 commits into
devfrom
maybe-faster

Conversation

@balloob
Copy link
Copy Markdown
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
Copy Markdown
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.

4 participants