nativeInvoke

@Target(allowedTargets = [AnnotationTarget.FUNCTION])
actual annotation class nativeInvoke(source)

Deprecated

Use inline extension function with body using dynamic

Since Kotlin

1.1

Deprecated

Temporary solution until WasmJs <-> Js interoperability will be designed. It may be removed in the future releases.

Marks a member function of an external declaration as the "invoke operator" of a JavaScript object. Every call to this function will be translated into a call of the object itself.

Example:

external class A {
@nativeInvoke
operator fun invoke()
}

fun main() {
val a = A()
a()
}

Since Kotlin

2.3