Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/easyts/channel.ts>ReadCaseLike

js library written with ts, use select and chan like golang in js.
Latest
interface ReadCaseLike
import { type ReadCaseLike } from "https://deno.land/x/easyts@0.1.3/channel.ts";

Properties

readonly
isReady: boolean

Returns whether this case is ready

Methods

reset(): void

reset read-write status

tryInvoke(): boolean
do(resolve: (c: CaseLike) => void, reject: (c: CaseLike) => void): Connection
invoke(): Promise<void>
read(): undefined | any

Returns the value read by the case, throws an exception if the case is not ready

readRaw(): [undefined, false] | [any, true]

Returns the value read by the case, throws an exception if the case is not ready