You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.