bod
04/22/2022, 6:25 AMAsyncIterator
. For instance here's something in JS :
myAsyncIterator = async function* () {
for await (const word of ["one", "two", "three"]) {
yield { count: word };
}
}
Any idea how to write an equivalent in Kotlin?turansky
04/22/2022, 11:57 AMAsyncIterator
contract in lib.dom.d.ts
to write effective addapterbod
04/22/2022, 12:36 PMbod
04/22/2022, 12:38 PMbod
04/22/2022, 12:38 PMturansky
04/22/2022, 10:39 PMI can’t seem to find it there 🤔Do you use IDEA?
turansky
04/22/2022, 11:13 PMbod
04/23/2022, 8:06 AMturansky
04/23/2022, 7:00 PMturansky
04/23/2022, 7:01 PMbod
04/23/2022, 7:05 PMturansky
04/23/2022, 7:14 PMturansky
04/23/2022, 7:23 PMVery interesting! I wonder why I can’t see this but I’ll investigate1. Create JS file 2. Write
Symbol.asyncIterator
3. Cmd
+ click on asyncIterator
4. PROFITturansky
04/24/2022, 11:48 AMbod
04/24/2022, 12:27 PMbod
04/24/2022, 4:21 PMturansky
04/24/2022, 6:23 PMbod
04/27/2022, 8:16 AMbod
04/27/2022, 8:16 AMdynamic
so it's weakly typed, but that's ok for my use-caseturansky
04/27/2022, 9:31 AMSergei Grishchenko
04/27/2022, 10:14 AMfunction*
) relates to suspend
in Kotlin but I think we (wrappers developers) need some invent some wrappers and strategies to make integration to generators more seamless, example of such integration is
public suspend fun <T> kotlin.js.Promise<T>.await(): T { /* compiled code */ }
from kotlinx.coroutines
bod
04/27/2022, 12:34 PM