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

ES6 iterators - enable ForOf for collections #47

Closed
wants to merge 5 commits into from

Conversation

vdolek
Copy link

@vdolek vdolek commented Jun 21, 2020

This PR implements ES6 iterators for all collections in the library. It enables using ForOf with collections without using toArray() method.

Example:

const list = new List([1, 2, 3]);
for (const item of list) {
    console.log(item);
}

Besides that it allows using collections with *ngFor in Angular without using toArray() method.

@vdolek
Copy link
Author

vdolek commented Jun 22, 2020

Hi @isc30, will you be able to review and possibly merge and publish this PR?

@isc30
Copy link
Owner

isc30 commented Jun 22, 2020

Hi there, this lib aims for ES5 compatibility and it has no Symbol.Iterator due to this limitation.
If you want, you can publish your fork in NPM as Linq-Collections-ES6 and get these new features rolling there!

@vdolek
Copy link
Author

vdolek commented Jun 22, 2020

In the end this PR is published separately in https://www.npmjs.com/package/linq-collections-es6.

@vdolek vdolek closed this Jun 22, 2020
@isc30
Copy link
Owner

isc30 commented Jun 22, 2020

Awesome! Thanks a lot

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

Successfully merging this pull request may close these issues.

None yet

3 participants