Skip to content

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