I see that `@JvmName` can be used on common module...
# multiplatform
m
I see that
@JvmName
can be used on common modules, but
@JsName
not. Any way to set name for JS in multiplatform projects? (Problem is that JS doesn't accept names like
Copy code
fun `this is name`(){}
)
a
You could
expect
a custom annotation in your common module and
typealias
it to
@JsName
in JS module. When compiling to JavaScript that would work as if you've used
@JsName
in the common code.
m
Thanks, simple idea but it works perfectly 🙂
a
You are welcome. We are aware that using platfrom annotations in common code is not convenient at the moment. Hopefully there will be an easier solution before MPP is officially released (it is experimental for now).
m
Yeah. Kotlin was in experimental stage for like 6 years xP But I've been using it on the production eather way 😉
a
😀