import { tagged } from "https://deno.land/x/async_channels@v1.0.0-rc8/mod.ts";
const { select } = tagged;
A tagged-template version of select.
Format:
import {Channel} from "../channel.ts";
import {select} from "./select.ts";
const ch1 = new Channel();
const ch2 = new Channel();
const res = await select`
case ${ch1}: ${(val) => "Will be called if ch1 was sent val"}
case ${[ch2, "val"]}: ${() => "Will be called if ch2 accepted 'val'"}
default: ${() => "Will be called if no other channel is ready for get / send"}
`
console.log(res)
Parameters
...args: (SelectOperation<unknown> | SelectHandler<unknown, unknown>)[]