Axel
06/16/2018, 8:16 AMDeactivated User
06/16/2018, 9:59 AMinline
+ reified
to avoid the ::class
(untested):
inline fun <reified T : Any> HypercubeSockets.on(event: String, handler: suspend HypercubeSession.(T) -> Unit) = on(event, T::class, handler)
Would look like this:
on<String>("message") { message -> ... }
// or
on("message") { message: String -> ... }
Axel
06/16/2018, 11:52 AM