I'm new to Kotlin and I'm trying to perform the equivalent of this JS snippet from Kotlin/JS. myFunction is supposed to return a Promise of Something:
myFunction()
.then(onSuccess, onFailure);
function onSuccess(something) {
console.log(something);
}
function onFailure() {
console.log('Error!');
}
How would you do that from Kotlin?