apatrida
08/29/2015, 2:54 PMkotlin
val getMyThing = fun Context.(parm: String): Thing { ... }
Since I can use a MyClass::getMyThing
reference to find the route it was attached to.
hrefFrom(MyClass::getMyThing) // bare, ignore query string, error on path parms
hrefFrom(MyClass::getMyThing, mapOf("parm" to parmValue)) // with query or path parms
// or extend the reference itself but maybe only want to do that in context of the system so I
// don't litter references that don't make sense to have an href:
MyClass::getMyThing.href()
Your HREF doesn't really take into consideration which parameters are needed to make the URL, if you want the query string or not, and if some of them are hidden as FORM parameters instead of query/path parameters. You then have to make things nullable that you don't want to have to provide in the query string to generate a bare link (that someone else can add their own query parameters to, or part of them).