canjs / can-route

Observable front-end application routing for CanJS.
https://canjs.com/doc/can-route.html
MIT License
10 stars 4 forks source link

can-route param and deparam weirdly include the route Rule #137

Closed justinbmeyer closed 6 years ago

justinbmeyer commented 6 years ago
param( data, [preferredRouteRuleName] ) //-> "foo/bar"

var {routeRule, data} = deparam( url );

// WINNER
route.deparam(url) //-> data 
route.rule(url) //-> routeRuleName

recipes/5 -> {page: "recipes", recipeId: 5}
todos/56  ->   {page: "todos", todoId: 56}
    register("recipes/{recipesId",{page: "recipes"})

route.deparam(url, route.rule(url) )