Documentation
    Preparing search index...

    Variable fromIterableConst

    fromIterable: {
        <T>(
            collection:
                | Iterator<T, any, any>
                | Iterable<T, any, any>
                | AsyncIterator<T, any, any>
                | AsyncIterable<T, any, any>
                | ArrayLike<T>,
            queuingStrategy?: QueuingStrategy<T>,
        ): ReadableStream<T>;
        <T extends Record<string | symbol, unknown>>(
            collection: T,
            queuingStrategy?: QueuingStrategy<T>,
        ): ReadableStream<Entries<T>>;
    } = fromCollection

    Type Declaration

      • <T>(
            collection:
                | Iterator<T, any, any>
                | Iterable<T, any, any>
                | AsyncIterator<T, any, any>
                | AsyncIterable<T, any, any>
                | ArrayLike<T>,
            queuingStrategy?: QueuingStrategy<T>,
        ): ReadableStream<T>
      • Creates a readable stream from an collection of values.

        Type Parameters

        • T

        Parameters

        • collection:
              | Iterator<T, any, any>
              | Iterable<T, any, any>
              | AsyncIterator<T, any, any>
              | AsyncIterable<T, any, any>
              | ArrayLike<T>
        • OptionalqueuingStrategy: QueuingStrategy<T>

        Returns ReadableStream<T>

        Using an Iterable

        fromCollection([1, 2, 3, 4])
        

        Using an AsyncIterable

        fromCollection((async function* () {
        yield 1
        })())

        Using an ArrayLike

        fromCollection({
        0: 'zero',
        1: 'one',
        2: 'two',
        length: 3,
        })

        Streaming object entries

        fromCollection({
        one: 1,
        two: 2,
        three: 3,
        })
        // -[one, 1]-[two, 2]-[threee, 3]-|
      • <T extends Record<string | symbol, unknown>>(
            collection: T,
            queuingStrategy?: QueuingStrategy<T>,
        ): ReadableStream<Entries<T>>
      • Creates a readable stream from an collection of values.

        Type Parameters

        • T extends Record<string | symbol, unknown>

        Parameters

        • collection: T
        • OptionalqueuingStrategy: QueuingStrategy<T>

        Returns ReadableStream<Entries<T>>

        Using an Iterable

        fromCollection([1, 2, 3, 4])
        

        Using an AsyncIterable

        fromCollection((async function* () {
        yield 1
        })())

        Using an ArrayLike

        fromCollection({
        0: 'zero',
        1: 'one',
        2: 'two',
        length: 3,
        })

        Streaming object entries

        fromCollection({
        one: 1,
        two: 2,
        three: 3,
        })
        // -[one, 1]-[two, 2]-[threee, 3]-|

    Use fromCollection instead.