ramda-adjunct icon indicating copy to clipboard operation
ramda-adjunct copied to clipboard

isAsyncIterable

Open char0n opened this issue 6 years ago • 4 comments

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

char0n avatar May 22 '19 19:05 char0n

Hi @char0n , can you assign this to me? I already have this feature implemented.

sigfriedCub1990 avatar Jun 27 '22 17:06 sigfriedCub1990

@sigfriedCub1990, assigned, I'll look into the PR shortly.

char0n avatar Jul 03 '22 18:07 char0n

What is a use case for this? I do not see the necessity for this feature tbh. Does RA support async iterators for map, filter, etc.?

levino avatar Sep 27 '22 07:09 levino

@levino it's just a simple predicate that tell you if the input value is async iterable or not.

Does RA support async iterators for map, filter, etc.?

RA doesn't support async interators for map, filter and others. As mentioned, it's just a predicate.

char0n avatar Sep 27 '22 08:09 char0n