Feeding this into switchPath
const Routes = {
"/": Home,
"/login": Login,
'*': function(){return {DOM: xs.of(<h1> 404</h1>)}}
}
navigating to /lossgin will log that current route/path is "/".
404)}} } navigating to /lossgin" /> 404)}} } navigating to /lossgin" /> 404)}} } navigating to /lossgin"/>
Feeding this into switchPath
const Routes = {
"/": Home,
"/login": Login,
'*': function(){return {DOM: xs.of(<h1> 404</h1>)}}
}
navigating to /lossgin will log that current route/path is "/".
This appears to be a problem with switch-path. (And nothing to do with CycleJS history)
See this switch-path issue and this pull request.
Simply put, the wildcard * does not get captured when route '/' is in use and there are no nested routes. For example:
console.log(path, value)produces:A work-around is to change your
loginroute to a nested route:console.log(path, value)produces:See code example here.