Closed webdesserts closed 10 years ago
crossroads keeps an internal state
of previously matched routes and previous request (so it can notify the switched
signal and to avoid multiple consecutive matches).
you can toggle the behavior with crossroads.ignoreState = true
: http://millermedeiros.github.io/crossroads.js/#crossroads-ignoreState
this was a breaking change introduced on v0.11.0 (semver fail)
PS: this is the default behavior because crossroads was initially designed to be used on the front-end.. and on most client-side apps routes should only be triggered once. sorry for the inconvenience.
Ahh that makes sense. I kinda thought it was acting like a client side router, I just didn't know what I needed to do to switch it. I think I saw...
This feature should NOT be needed by most users.
...in the documentation and just skipped over all the state stuff.
Thanks for your help.
I am attempting to write a Node.js app with crossroads. Unfortunately I've run into a problem where crossroads will only run the function when a route is matched once. This includes the bypassed function as well. I've simplified my code a bit to demonstrate the problem:
app.js
routes/index.js
and here's a quick gif of what's happening:
What am I doing wrong that's causing this? Any help would be appreciated.