kingsley
06/03/2017, 7:43 AMval handler: Handler = { req, res -> res.body("Hello") }
Is it bad practice? To declare lambdas? No, it's perfectly fine.tipsy
06/03/2017, 7:44 AM@FunctionalInterface
@Throws(Exception::class)
fun handle(request: Request, response: Response)
i need to add a constructor in order to do thatkingsley
06/03/2017, 7:47 AMtypealias Handler = (Request, Response) -> Unit
tipsy
06/03/2017, 7:48 AMkingsley
06/03/2017, 7:48 AMtipsy
06/03/2017, 7:51 AMkingsley
06/03/2017, 8:13 AMFunctionN
interfaces in Java which might not be as pretty as a specialized interface like your Handler