Prelude API
    Preparing search index...
    • Creates a producer that yields a single value once.

      Type Parameters

      • T

      Parameters

      • value: T | Promise<T>

        The value or promise to yield

      Returns AsyncGenerator<T>

      An async generator that yields the provided value once

      This function creates an async generator that yields the given value exactly once and then completes. It supports both synchronous values and promises, waiting for the promise to resolve before yielding.

      // Yield a single value
      const result = await G.pipe(
      G.yield(42),
      G.array
      ); // [42]

      // Yield a promised value
      const result = await G.pipe(
      G.yield(Promise.resolve("hello")),
      G.array
      ); // ["hello"]