Options
All
  • Public
  • Public/Protected
  • All
Menu

Package asynciterable

@typed/asynciterable

A collection of useful function to work with AsyncIterables

Index

Variables

Const ap

ap: { <A, B>(fn: AsyncIterable<Arity1<A, B>>, value: AsyncIterable<A>): AsyncIterable<B>; <A, B>(fn: AsyncIterable<Arity1<A, B>>): (value: AsyncIterable<A>) => AsyncIterable<B> } = curry(<A, B>(fn: AsyncIterable<Arity1<A, B>>, value: AsyncIterable<A>): AsyncIterable<B> =>chain((f) => map(f, value), fn),) as {<A, B>(fn: AsyncIterable<Arity1<A, B>>, value: AsyncIterable<A>): AsyncIterable<B><A, B>(fn: AsyncIterable<Arity1<A, B>>): (value: AsyncIterable<A>) => AsyncIterable<B>}

Apply an async iterable of functions to an async iterable of values.

Type declaration

    • <A, B>(fn: AsyncIterable<Arity1<A, B>>, value: AsyncIterable<A>): AsyncIterable<B>
    • <A, B>(fn: AsyncIterable<Arity1<A, B>>): (value: AsyncIterable<A>) => AsyncIterable<B>
    • Type parameters

      • A

      • B

      Parameters

      • fn: AsyncIterable<Arity1<A, B>>
      • value: AsyncIterable<A>

      Returns AsyncIterable<B>

    • Type parameters

      • A

      • B

      Parameters

      • fn: AsyncIterable<Arity1<A, B>>

      Returns (value: AsyncIterable<A>) => AsyncIterable<B>

        • (value: AsyncIterable<A>): AsyncIterable<B>
        • Parameters

          • value: AsyncIterable<A>

          Returns AsyncIterable<B>

Const append

append: { <A>(value: A, asyncIterable: AsyncIterable<A>): AsyncIterable<A>; <A>(value: A): (asyncIterable: AsyncIterable<A>) => AsyncIterable<A> } = curry(__append)

Type declaration

    • <A>(value: A, asyncIterable: AsyncIterable<A>): AsyncIterable<A>
    • <A>(value: A): (asyncIterable: AsyncIterable<A>) => AsyncIterable<A>
    • Type parameters

      • A

      Parameters

      • value: A
      • asyncIterable: AsyncIterable<A>

      Returns AsyncIterable<A>

    • Type parameters

      • A

      Parameters

      • value: A

      Returns (asyncIterable: AsyncIterable<A>) => AsyncIterable<A>

        • (asyncIterable: AsyncIterable<A>): AsyncIterable<A>
        • Parameters

          • asyncIterable: AsyncIterable<A>

          Returns AsyncIterable<A>

Const chain

chain: { <A, B>(fn: Arity1<A, AsyncIterable<B>>, asyncIterable: AsyncIterable<A>): AsyncIterable<B>; <A, B>(fn: Arity1<A, AsyncIterable<B>>): (asyncIterable: AsyncIterable<A>) => AsyncIterable<B> } = curry(__chain)

Type declaration

    • <A, B>(fn: Arity1<A, AsyncIterable<B>>, asyncIterable: AsyncIterable<A>): AsyncIterable<B>
    • <A, B>(fn: Arity1<A, AsyncIterable<B>>): (asyncIterable: AsyncIterable<A>) => AsyncIterable<B>
    • Type parameters

      • A

      • B

      Parameters

      • fn: Arity1<A, AsyncIterable<B>>
      • asyncIterable: AsyncIterable<A>

      Returns AsyncIterable<B>

    • Type parameters

      • A

      • B

      Parameters

      • fn: Arity1<A, AsyncIterable<B>>

      Returns (asyncIterable: AsyncIterable<A>) => AsyncIterable<B>

        • (asyncIterable: AsyncIterable<A>): AsyncIterable<B>
        • Parameters

          • asyncIterable: AsyncIterable<A>

          Returns AsyncIterable<B>

Const concat

concat: { <A>(a: AsyncIterable<A>, b: AsyncIterable<A>): AsyncIterable<A>; <A>(a: AsyncIterable<A>): (b: AsyncIterable<A>) => AsyncIterable<A> } = curry(__concat)

Type declaration

    • <A>(a: AsyncIterable<A>, b: AsyncIterable<A>): AsyncIterable<A>
    • <A>(a: AsyncIterable<A>): (b: AsyncIterable<A>) => AsyncIterable<A>
    • Type parameters

      • A

      Parameters

      • a: AsyncIterable<A>
      • b: AsyncIterable<A>

      Returns AsyncIterable<A>

    • Type parameters

      • A

      Parameters

      • a: AsyncIterable<A>

      Returns (b: AsyncIterable<A>) => AsyncIterable<A>

        • (b: AsyncIterable<A>): AsyncIterable<A>
        • Parameters

          • b: AsyncIterable<A>

          Returns AsyncIterable<A>

Const contains

contains: { <A>(value: A, asyncIterable: AsyncIterable<A>): Promise<boolean>; <A>(value: A): (asyncIterable: AsyncIterable<A>) => Promise<boolean> } = curry(__contains)

Type declaration

    • <A>(value: A, asyncIterable: AsyncIterable<A>): Promise<boolean>
    • <A>(value: A): (asyncIterable: AsyncIterable<A>) => Promise<boolean>
    • Type parameters

      • A

      Parameters

      • value: A
      • asyncIterable: AsyncIterable<A>

      Returns Promise<boolean>

    • Type parameters

      • A

      Parameters

      • value: A

      Returns (asyncIterable: AsyncIterable<A>) => Promise<boolean>

        • (asyncIterable: AsyncIterable<A>): Promise<boolean>
        • Parameters

          • asyncIterable: AsyncIterable<A>

          Returns Promise<boolean>

Const drop

drop: { <A>(amount: number, asyncIterable: AsyncIterable<A>): AsyncIterable<A>; (amount: number): <A>(asyncIterable: AsyncIterable<A>) => AsyncIterable<A> } = curry(__drop) as {<A>(amount: number, asyncIterable: AsyncIterable<A>): AsyncIterable<A>(amount: number): <A>(asyncIterable: AsyncIterable<A>) => AsyncIterable<A>}

Type declaration

    • <A>(amount: number, asyncIterable: AsyncIterable<A>): AsyncIterable<A>
    • (amount: number): <A>(asyncIterable: AsyncIterable<A>) => AsyncIterable<A>
    • Type parameters

      • A

      Parameters

      • amount: number
      • asyncIterable: AsyncIterable<A>

      Returns AsyncIterable<A>

    • Parameters

      • amount: number

      Returns <A>(asyncIterable: AsyncIterable<A>) => AsyncIterable<A>

        • <A>(asyncIterable: AsyncIterable<A>): AsyncIterable<A>
        • Type parameters

          • A

          Parameters

          • asyncIterable: AsyncIterable<A>

          Returns AsyncIterable<A>

Const filter

filter: { <A>(predicate: Predicate<A>, asyncIterable: AsyncIterable<A>): AsyncIterable<A>; <A>(predicate: Predicate<A>): (asyncIterable: AsyncIterable<A>) => AsyncIterable<A> } = curry(__filter)

Type declaration

    • <A>(predicate: Predicate<A>, asyncIterable: AsyncIterable<A>): AsyncIterable<A>
    • <A>(predicate: Predicate<A>): (asyncIterable: AsyncIterable<A>) => AsyncIterable<A>
    • Type parameters

      • A

      Parameters

      • predicate: Predicate<A>
      • asyncIterable: AsyncIterable<A>

      Returns AsyncIterable<A>

    • Type parameters

      • A

      Parameters

      Returns (asyncIterable: AsyncIterable<A>) => AsyncIterable<A>

        • (asyncIterable: AsyncIterable<A>): AsyncIterable<A>
        • Parameters

          • asyncIterable: AsyncIterable<A>

          Returns AsyncIterable<A>

Const forEach

forEach: { <A>(fn: (value: A) => void, asyncIterable: AsyncIterable<A>): Promise<void>; <A>(fn: (value: A) => void): (asyncIterable: AsyncIterable<A>) => Promise<void> } = curry(__forEach)

Type declaration

    • <A>(fn: (value: A) => void, asyncIterable: AsyncIterable<A>): Promise<void>
    • <A>(fn: (value: A) => void): (asyncIterable: AsyncIterable<A>) => Promise<void>
    • Type parameters

      • A

      Parameters

      • fn: (value: A) => void
          • (value: A): void
          • Parameters

            • value: A

            Returns void

      • asyncIterable: AsyncIterable<A>

      Returns Promise<void>

    • Type parameters

      • A

      Parameters

      • fn: (value: A) => void
          • (value: A): void
          • Parameters

            • value: A

            Returns void

      Returns (asyncIterable: AsyncIterable<A>) => Promise<void>

        • (asyncIterable: AsyncIterable<A>): Promise<void>
        • Parameters

          • asyncIterable: AsyncIterable<A>

          Returns Promise<void>

Const map

map: { <A, B>(fn: Arity1<A, B>, asyncIterable: AsyncIterable<A>): AsyncIterable<B>; <A, B>(fn: Arity1<A, B>): (asyncIterable: AsyncIterable<A>) => AsyncIterable<B> } = curry(__map)

Type declaration

    • <A, B>(fn: Arity1<A, B>, asyncIterable: AsyncIterable<A>): AsyncIterable<B>
    • <A, B>(fn: Arity1<A, B>): (asyncIterable: AsyncIterable<A>) => AsyncIterable<B>
    • Type parameters

      • A

      • B

      Parameters

      • fn: Arity1<A, B>
      • asyncIterable: AsyncIterable<A>

      Returns AsyncIterable<B>

    • Type parameters

      • A

      • B

      Parameters

      Returns (asyncIterable: AsyncIterable<A>) => AsyncIterable<B>

        • (asyncIterable: AsyncIterable<A>): AsyncIterable<B>
        • Parameters

          • asyncIterable: AsyncIterable<A>

          Returns AsyncIterable<B>

Const prepend

prepend: { <A>(value: A, asyncIterable: AsyncIterable<A>): AsyncIterable<A>; <A>(value: A): (asyncIterable: AsyncIterable<A>) => AsyncIterable<A> } = curry(__prepend)

Type declaration

    • <A>(value: A, asyncIterable: AsyncIterable<A>): AsyncIterable<A>
    • <A>(value: A): (asyncIterable: AsyncIterable<A>) => AsyncIterable<A>
    • Type parameters

      • A

      Parameters

      • value: A
      • asyncIterable: AsyncIterable<A>

      Returns AsyncIterable<A>

    • Type parameters

      • A

      Parameters

      • value: A

      Returns (asyncIterable: AsyncIterable<A>) => AsyncIterable<A>

        • (asyncIterable: AsyncIterable<A>): AsyncIterable<A>
        • Parameters

          • asyncIterable: AsyncIterable<A>

          Returns AsyncIterable<A>

Const range

range: { (from: number, to: number): AsyncIterable<number>; (from: number): (to: number) => AsyncIterable<number> } = curry((from: number, to: number) => __rangeBy(from, to, 1))

Inclusive range by 1

Type declaration

    • (from: number, to: number): AsyncIterable<number>
    • (from: number): (to: number) => AsyncIterable<number>
    • Parameters

      • from: number
      • to: number

      Returns AsyncIterable<number>

    • Parameters

      • from: number

      Returns (to: number) => AsyncIterable<number>

        • (to: number): AsyncIterable<number>
        • Parameters

          • to: number

          Returns AsyncIterable<number>

Const rangeBy

rangeBy: { (from: number, to: number, by: number): AsyncIterable<number>; (from: number, to: number): (by: number) => AsyncIterable<number>; (from: number): { (to: number, by: number): AsyncIterable<number>; (to: number): (by: number) => AsyncIterable<number> } } = curry(__rangeBy)

Inclusive range by given increment

Type declaration

    • (from: number, to: number, by: number): AsyncIterable<number>
    • (from: number, to: number): (by: number) => AsyncIterable<number>
    • (from: number): { (to: number, by: number): AsyncIterable<number>; (to: number): (by: number) => AsyncIterable<number> }
    • Parameters

      • from: number
      • to: number
      • by: number

      Returns AsyncIterable<number>

    • Parameters

      • from: number
      • to: number

      Returns (by: number) => AsyncIterable<number>

        • (by: number): AsyncIterable<number>
        • Parameters

          • by: number

          Returns AsyncIterable<number>

    • Parameters

      • from: number

      Returns { (to: number, by: number): AsyncIterable<number>; (to: number): (by: number) => AsyncIterable<number> }

        • (to: number, by: number): AsyncIterable<number>
        • (to: number): (by: number) => AsyncIterable<number>
        • Parameters

          • to: number
          • by: number

          Returns AsyncIterable<number>

        • Parameters

          • to: number

          Returns (by: number) => AsyncIterable<number>

            • (by: number): AsyncIterable<number>
            • Parameters

              • by: number

              Returns AsyncIterable<number>

Const reduce

reduce: { <A, B>(reducer: Arity2<B, A, B>, seed: B, asyncIterable: AsyncIterable<A>): Promise<B>; <A, B>(reducer: Arity2<B, A, B>, seed: B): (asyncIterable: AsyncIterable<A>) => Promise<B>; <A, B>(reducer: Arity2<B, A, B>): { (seed: B, asyncIterable: AsyncIterable<A>): Promise<B>; (seed: B): (asyncIterable: AsyncIterable<A>) => Promise<B> } } = curry(__reduce)

Type declaration

    • <A, B>(reducer: Arity2<B, A, B>, seed: B, asyncIterable: AsyncIterable<A>): Promise<B>
    • <A, B>(reducer: Arity2<B, A, B>, seed: B): (asyncIterable: AsyncIterable<A>) => Promise<B>
    • <A, B>(reducer: Arity2<B, A, B>): { (seed: B, asyncIterable: AsyncIterable<A>): Promise<B>; (seed: B): (asyncIterable: AsyncIterable<A>) => Promise<B> }
    • Type parameters

      • A

      • B

      Parameters

      • reducer: Arity2<B, A, B>
      • seed: B
      • asyncIterable: AsyncIterable<A>

      Returns Promise<B>

    • Type parameters

      • A

      • B

      Parameters

      • reducer: Arity2<B, A, B>
      • seed: B

      Returns (asyncIterable: AsyncIterable<A>) => Promise<B>

        • (asyncIterable: AsyncIterable<A>): Promise<B>
        • Parameters

          • asyncIterable: AsyncIterable<A>

          Returns Promise<B>

    • Type parameters

      • A

      • B

      Parameters

      Returns { (seed: B, asyncIterable: AsyncIterable<A>): Promise<B>; (seed: B): (asyncIterable: AsyncIterable<A>) => Promise<B> }

        • (seed: B, asyncIterable: AsyncIterable<A>): Promise<B>
        • (seed: B): (asyncIterable: AsyncIterable<A>) => Promise<B>
        • Parameters

          • seed: B
          • asyncIterable: AsyncIterable<A>

          Returns Promise<B>

        • Parameters

          • seed: B

          Returns (asyncIterable: AsyncIterable<A>) => Promise<B>

            • (asyncIterable: AsyncIterable<A>): Promise<B>
            • Parameters

              • asyncIterable: AsyncIterable<A>

              Returns Promise<B>

Const take

take: { <A>(amount: number, asyncIterable: AsyncIterable<A>): AsyncIterable<A>; (amount: number): <A>(asyncIterable: AsyncIterable<A>) => AsyncIterable<A> } = curry(__take) as {<A>(amount: number, asyncIterable: AsyncIterable<A>): AsyncIterable<A>(amount: number): <A>(asyncIterable: AsyncIterable<A>) => AsyncIterable<A>}

Type declaration

    • <A>(amount: number, asyncIterable: AsyncIterable<A>): AsyncIterable<A>
    • (amount: number): <A>(asyncIterable: AsyncIterable<A>) => AsyncIterable<A>
    • Type parameters

      • A

      Parameters

      • amount: number
      • asyncIterable: AsyncIterable<A>

      Returns AsyncIterable<A>

    • Parameters

      • amount: number

      Returns <A>(asyncIterable: AsyncIterable<A>) => AsyncIterable<A>

        • <A>(asyncIterable: AsyncIterable<A>): AsyncIterable<A>
        • Type parameters

          • A

          Parameters

          • asyncIterable: AsyncIterable<A>

          Returns AsyncIterable<A>

Functions

collect

  • collect<A>(asyncIterable: AsyncIterable<A>): Promise<A[]>

Generated using TypeDoc