Sitelet https://github.com/purescript-halogen/purescript-halogen/pull/676
Skip to content

Read most recent driver state when disposing - #676

Merged
thomashoneyman merged 1 commit into
purescript-halogen:masterfrom
thomashoneyman:dispose-fix
Jun 18, 2020
Merged

thomashoneyman merged 1 commit into
purescript-halogen:masterfrom
thomashoneyman:dispose-fix

Conversation

@thomashoneyman

Copy link
Copy Markdown
Member

Fixes #675. I noticed while writing up the issue that a call to dispose will use the driver state it received when the component was first run, and will attempt to dispose the rendered tree at that time. Instead, we need to use the latest driver state when disposing.

This PR reads the latest driver state and works correctly in my test case in #675.

@garyb garyb left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Subtle!

@thomashoneyman
thomashoneyman merged commit 3ee1bb2 into purescript-halogen:master Jun 18, 2020
@thomashoneyman
thomashoneyman deleted the dispose-fix branch June 18, 2020 21:59
milesfrain pushed a commit to milesfrain/purescript-halogen that referenced this pull request Jun 28, 2020
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.

Disposal fails if component root element changes

3 participants