Hi everyone, I made a nice event based wrapper for...
# ktor
a
Hi everyone, I made a nice event based wrapper for Ktor WebSockets. Because this is my first library I could really use your feedbacks to improve my coding / sharing skills, so do not hesitate to point me anything ! https://github.com/rozaxe/hypercube
👍 2
d
Looks good 🙂 You can try to add an
inline
+
reified
to avoid the
::class
(untested):
Copy code
inline fun <reified T : Any> HypercubeSockets.on(event: String, handler:  suspend HypercubeSession.(T) -> Unit) = on(event, T::class, handler)
Would look like this:
Copy code
on<String>("message") { message -> ... }
// or
on("message") { message: String -> ... }
a
Waouw, I didn't knew we could use it like that. Thanks !