manoj s
05/30/2023, 7:38 PMfor await...of
in kotlin/js.
here is the pure js sample code
const sub = await this.nats.jetstream().subscribe(subject, opts)
for await(const m of sub) { // what's the kotlin/js equivalent
const data = this.jc.decode(m.data)
switch (data.type) {
case "draw":
break;
case "clear":
log("clear")
default:
break;
}
}
Would appreciate any pointers or examples.turansky
05/31/2023, 11:36 AMjanvladimirmostert
05/31/2023, 12:15 PMturansky
05/31/2023, 12:53 PMsub
- AsyncIterableMoritz Hofmeister
05/31/2023, 1:09 PMmanoj s
06/01/2023, 11:27 AMturansky
06/01/2023, 12:49 PMturansky
06/02/2023, 3:24 PMpre.556
AsyncIterable.iterator
extension is availableturansky
06/02/2023, 3:25 PMfor
must work fine