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

destroy function #153

Open
mafar opened this issue Oct 14, 2016 · 1 comment
Open

destroy function #153

mafar opened this issue Oct 14, 2016 · 1 comment

Comments

@mafar
Copy link

mafar commented Oct 14, 2016

Is there a way to completely destroy crossroads instance.
I am using it in single page app and it is driving me nuts.
After logout and re login .. I want to create instance of router newly but it it keeps adding routes to previous state.

@fayway
Copy link

fayway commented Oct 26, 2016

Do you use hasher to handle history state changes? if the answer is yes, during your logout routine, you need to call:

crossroads.removeAllRoutes();

but also:

hasher.changed.removeAll();
hasher.initialized.removeAll();

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

No branches or pull requests

2 participants