Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

isAsyncIterable #937

Open
char0n opened this issue May 22, 2019 · 4 comments · May be fixed by #2309
Open

isAsyncIterable #937

char0n opened this issue May 22, 2019 · 4 comments · May be fixed by #2309
Assignees

Comments

@char0n
Copy link
Owner

char0n commented May 22, 2019

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 char0n changed the title Async iterator predicate isAsyncIterable May 22, 2019
@char0n char0n added the Hacktoberfest Hacktoberfest 2020 label Sep 13, 2020
@sigfriedCub1990
Copy link

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

sigfriedCub1990 added a commit to sigfriedCub1990/ramda-adjunct that referenced this issue Jun 27, 2022
@sigfriedCub1990 sigfriedCub1990 linked a pull request Jun 27, 2022 that will close this issue
sigfriedCub1990 added a commit to sigfriedCub1990/ramda-adjunct that referenced this issue Jun 27, 2022
@char0n
Copy link
Owner Author

char0n commented Jul 3, 2022

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

@levino
Copy link

levino commented Sep 27, 2022

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.?

@char0n
Copy link
Owner Author

char0n commented Sep 27, 2022

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants