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

x/ayonli_jsext/chan.ts>Channel#recv

A JavaScript extension package for building strong and modern applications.
Latest
method Channel.prototype.recv
import { Channel } from "https://deno.land/x/ayonli_jsext@v0.9.72/chan.ts";

Retrieves data from the channel.

If there isn't data available at the moment, this function will block until new data is available.

If the channel is closed, then:

  • If there is error set in the channel, this function throws that error immediately.
  • Otherwise, this function returns undefined immediately.

Returns

Promise<T | undefined>