ChemPare Documentation - v0.0.0
    Preparing search index...

    Type Alias Awaitable<T>

    Awaitable: T | Promise<T>

    Type that allows either a value or a Promise of that value. Used for functions that may return either synchronously or asynchronously.

    Type Parameters

    • T

      The type of the value

    // Example function returning either sync or async value
    async function getData(): Awaitable<string> {
    return Math.random() > 0.5
    ? "immediate value"
    : Promise.resolve("async value");
    }