JsFun

Implements annotated function in JavaScript and automatically imports is to Wasm. code string must contain JS expression that evaluates to JS function with signature that matches annotated kotlin function

For example, a function that adds two Doubles via JS:

@JsFun("(x, y) => x + y")
fun jsAdd(x: Double, y: Double): Double =
    error("...")

This is a temporary annotation because K/Wasm <-> JS interop is not designed yet.

Since Kotlin

1.8

Properties

Link copied to clipboard
Since Kotlin 1.8