Andromadus Naruto
06/19/2023, 4:28 PMExported declaration uses non-exportable return type: Either<DomainError, TodoDto>
. I understand that the Either type isn't annotated with @JsExport
that's why I get the warning. Is there a way to workaround this?
2. How would you recommend I use Arrow's suspending functions in a situation where suspending functions can't be used in a context with the @JsExport
?
Thanks in advance... 🙏🏾CLOVIS
06/19/2023, 8:43 PMjsMain
that return promises. For example, if your common code looks like this:
class Foo(
val a: Int,
) {
suspend fun foo(): Bar
}
you can create a wrapper for use by JS libraries:
@JsName("Foo")
class FooJs internal constructor(
private val wrapper: Foo,
) {
constructor(a: Int) : this(Foo(a))
fun foo() = promise { wrapper.foo() }
}
Andromadus Naruto
06/20/2023, 6:57 AM