Suppose I have a Kotlin Multiplatform project with a method, which takes an interface as an argument like this.
interface MyInterface {
operator fun invoke()
}
class MyClass {
fun execute(client: MyInterface) {
client()
}
}
In Java I could just call the execute() method like this:
void test() {
MyClass myClass = new MyClass();
myClass.execute(() -> {
//Do stuff
});
}
Now in my Multiplatform project I have generated the JS file, but how do I call it in JavaScript, since JS doesn’t have interfaces? I am trying to do this in Node.js.