Skip to content

isAsyncIterable #937

@char0n

Description

@char0n

Is your feature request related to a problem? Please describe.

Checks whether the passed value is async iterable.

Describe the solution you'd like

const myAsyncIterable = new Object();
myAsyncIterable[Symbol.asyncIterator] = async function*() {
    yield "hello";
    yield "async";
    yield "iteration!";
};

RA.isAsyncIterable(['arrays', 'are', 'iterable']); //=> false
RA.isAsyncIterable(myAsyncIterable); //=> true

Describe alternatives you've considered

--

Additional context

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/asyncIterator

Metadata

Metadata

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions