What's the deal with `KFunction1<@ParameterName...
# codereview
v
What's the deal with
KFunction1<@ParameterName(name = "ctx") RoutingContext, Unit>
? Is it better than
(ctx: RoutingContext) -> Unit
?
j
The second one I’ve used before, but that forces me to pass in the context as far as I can see.
Copy code
router.blockingPost2("/blah", LoginController.logout(context))
The first one was generated by IntelliJ when I typed
HomeController::default
and alt-entered it to autocomplete the signature of the extension function. I’m still reading up on what KFunction1 actually does, looks like reflection + magic.
v
Their usage must be the same AFAIK
They are certainly the same on the byte code level
👍 1