Hi everyone, I'm currently working on a Kotlin Mul...
# ktor
s
Hi everyone, I'm currently working on a Kotlin Multiplatform SDK that uses Ktor as the network client to handle all network calls and authentication. This SDK is designed to be consumed by Android, iOS, and web applications. The SDK includes several suspend functions to manage network calls, and I've successfully implemented and consumed it in both Android and iOS platforms. However, I'm facing an issue when trying to export this SDK for JavaScript. Specifically, I've encountered a problem where suspend methods cannot be exported for JavaScript. Has anyone dealt with this issue before or have any suggestions on how to work around it? Any guidance or examples of how to handle suspend methods for Kotlin Multiplatform targeting JavaScript would be greatly appreciated. Thanks in advance!
👍 1
e
Hey @Sahil0shrma, thanks for the question. @bashor, @anton.bannykh could you take a look?
▶️ 1
s
s
@stanislav.erokhin What will you recommend to run in background thread in all platforms?
🤷 1
s
well… there is no background thread on JS… I don’t know, I’m more the compiler person, not a library person. Maybe Leonig have some ideas.
s
@e5l @stanislav.erokhin Can you point me to any community resources or example projects that demonstrate how to handle similar issues in Kotlin Multiplatform with JavaScript?