Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Functions

run

  • run<U>(f: () => U): U
  • Run now

    Type parameters

    • U

    Parameters

    • f: () => U
        • (): U
        • Returns U

    Returns U

call

  • call(): void
  • call<U>(f: () => U): U
  • call<A, U>(...args: [...args: A[], f: (...args: A) => U]): U
  • Do nothing

    let a: undefined = call()
    

    Returns void

  • Run now

    let b: 0 = call(() => 0)
    

    Type parameters

    • U

    Parameters

    • f: () => U
        • (): U
        • Returns U

    Returns U

  • Call function

    let a: undefined = call()
    let b: 0 = call(() => 0)
    let c: 1 = call(1, v => v)
    let d: 3 = call(1, 2, (a, b) => a + b)

    Type parameters

    • A: any[]

    • U

    Parameters

    • Rest ...args: [...args: A[], f: (...args: A) => U]

    Returns U

used

  • used<T, U>(v: T, f: (v: T) => U): U
  • Use a value and make a mapping

    Type parameters

    • T

    • U

    Parameters

    • v: T
    • f: (v: T) => U
        • (v: T): U
        • Parameters

          • v: T

          Returns U

    Returns U

also

  • also<T>(v: T, f: (v: T) => void): T
  • Use value and do something extra

    Type parameters

    • T

    Parameters

    • v: T
    • f: (v: T) => void
        • (v: T): void
        • Parameters

          • v: T

          Returns void

    Returns T

collect

  • collect(): void
  • collect<T>(f: () => Iterable<T>): T[]
  • collect<A, T>(...args: [...args: A[], f: (...args: A) => Iterable<T>]): T[]
  • Do nothing

    let a: undefined = collect()
    

    Returns void

  • Collect Iterable or Generator

    let b: 1 = collect(function* () { yield 1 })
    

    Type parameters

    • T

    Parameters

    • f: () => Iterable<T>
        • (): Iterable<T>
        • Returns Iterable<T>

    Returns T[]

  • Call function

    let a: undefined = collect()
    let b: 1 = collect(function* () { yield 1 })
    let c: [1, 2, 3] = collect(1, 2, 3, function* (a, b, c) { yield* [a, b, c] })

    Type parameters

    • A: any[]

    • T

    Parameters

    • Rest ...args: [...args: A[], f: (...args: A) => Iterable<T>]

    Returns T[]

Generated using TypeDoc