lukeed/navaid

Clear route array on .unlisten()

mini-eggs opened this issue · 2 comments

Not sure if this was intended behavior or not, but I'd like the routes array to be cleared on .unlisten(). I have a different routing structure depending on mobile/desktop view and old handlers will still be called after I unlisten to the first router instance. I can submit a PR if interested?

False alarm. Must have been doing something odd in the application logic. Trying to isolate it and works just fine. My b!

Great! Yeah, an instance should be able to be reused. Detaching & reattaching listeners is one thing, but outright replacing is another. To "clear" routes, a new instance should be spun up in its place (after the previous was torn down).

Thanks!