I have a question regarding context receivers in K...
# ktor
a
I have a question regarding context receivers in Ktor. Ktor is one of those examples where context receivers make a lot of sense. E.g., I want to make an extension function on
Template<HTML>
which accesses the current
ApplicationCall
. As far as I know I can only achieve this by using context receivers. However, I am a bit reluctant in using it since it is not a stable feature and JVM only. Any thoughts on what would be wise and/or any workarounds?
a
You can always define a function with the receiver and pass the additional context as a parameter.
a
True. But that doesn’t create a nice api ;)