Open
Description
As seen in https://github.com/wasm-outbound-http-examples/kotlin/blob/main/browser/src/wasmJsMain/kotlin/Main.kt or some Spring + Kotlin/Wasm samples I have been working on, the requirement to return null
as the latest statement of some lambdas in some APIs exposed by kotlinx-browser
is a significant DevXP issue as it makes the Kotlin code IMO unnecessarily ugly and can block newcomers who will not understand that requirement. For example:
fun main() {
window.fetch("https://httpbin.org/anything").then {
if (it.ok) {
it.text().then {
println(it)
null
}
}
null
}
}
It impacts at least Promise<T>
based APIs and event handlers like those defined in GlobalEventHandlers
, potentially other APIs too.
It would be a big DevXP improvement if that could be fixed.
Metadata
Metadata
Assignees
Labels
No labels