import { selectChan } from "https://deno.land/x/easyts@0.1.3/mod.ts";
wait for a case to complete
Examples
Example 1
Example 1
const c0 = a.readCase()
const c1= b.writeCase()
const c2 = c.readCase()
switch (await selectChan(c0, c1,c2)) {
case c0:
break
case c1:
break
case c2:
break
}
default
default
const c0 = c.readCase()
switch (selectChan(0, c0)) {
case c0:
break
case 0:
break
}
Parameters
...cases: Array<CaseLike>
returns an Promise that waits forever