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

can't figure out how to create enumerable from javascript Iterable #51

Closed
jmagaram opened this issue May 10, 2018 · 2 comments
Closed

Comments

@jmagaram
Copy link

How do I get a javascript Iterable into your library? Should be simple.

function* words() : Iterable<string> {
    yield "abc";
    yield "def";
}

let x = Linq.from(words()); // does not work
@mihaifm
Copy link
Owner

mihaifm commented May 14, 2018

You can convert it to an array, then use Linq

Linq.from(Array.from(words()))

It would be nice if this worked directly, I'll try to look and see if anything can be done.

@xmedeko xmedeko mentioned this issue Sep 9, 2019
@mihaifm
Copy link
Owner

mihaifm commented Sep 11, 2019

This is now fixed, you can do Linq.from(words()) which is much better than converting to Array, since you can work with infinite iterables.

540699b

@mihaifm mihaifm closed this as completed Sep 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants