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

Remove event listeners of previous route component #89

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

suresh-gangumalla
Copy link
Collaborator

Removing event listeners of previous route component before creating target(next) route component instance.

Removing event listeners of previous route component before
creating target(next) route component instance.

Signed-off-by: Suresh Kumar Gangumalla <[email protected]>
Copy link
Collaborator

@michielvandergeest michielvandergeest left a comment

Choose a reason for hiding this comment

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

As discussed offline:

I think the responsibility of removing listeners does not lie with the router, but should be in the component. As the component already does this clean up, we should probably find a way to indicate to the component to (temporarily) not handle events, via a method or a property on the component.

This removes the need for having to re-register event listeners for when a previous page has the option to keep the page in memory. Also, since pages can stay in memory we need a flag or method to unset the "ignore events" behaviour.

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.

2 participants