No magic in Router init
Closed this issue · 3 comments
pauldijou commented
It's a personal opinion, but I don't really like mixing classic stuff with magic stuff. In the Router initialization, it looks like if a key is named "notFound", it will catch all unknow urls to redirect to the corresponding state. Meaning all keys match only one url except this magic one.
I would rather create a new method on the Router. Moving from:
Router({
home: State(),
contact: State(),
notFound: State()
})
to:
Router({
home: State(),
contact: State()
}).otherwise( State() )
sompylasar commented
That would be a good change if done.
AlexGalays commented
Yes that's probably a good idea :)
AlexGalays commented
Implemented in 67a49ea