FuncType - v0.16.0
    Preparing search index...

    Type Alias DoGenerator<T, TYield>

    DoGenerator: Generator<TYield, T, unknown>

    Type helper for Do-notation generators. Provides better type hints in IDEs.

    Type Parameters

    • T
    • TYield = unknown
    const result = Do(function* (): DoGenerator<number> {
    const x = yield* $(List([1, 2])) // x is still unknown but return type is clear
    const y = yield* $(List([3, 4]))
    return x + y
    })