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

only unmount components that return a function #9

Merged
merged 3 commits into from
Oct 16, 2019
Merged

only unmount components that return a function #9

merged 3 commits into from
Oct 16, 2019

Conversation

mikehwagz
Copy link
Collaborator

Addresses #8

During mount, component instances are only cached if they return a function. Additionally, the !document.documentElement.contains(node) condition has been removed from unmount. So, if a component does not return a function, evx event subscriptions are preserved after calling unmount. If a component does return a function, the function will be called and all evx event subscriptions will be destroyed — regardless of whether or not the component is still in the DOM.

Added a test for this new behavior and updated the readme.

Let me know what you think!

@estrattonbailey
Copy link
Collaborator

Looks great! Thanks! Will get this published.

@estrattonbailey estrattonbailey merged commit 4ad4595 into selfawarestudio:master Oct 16, 2019
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.

None yet

2 participants