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

Add IterableElement type #110

Merged
merged 17 commits into from
Sep 29, 2020
Merged

Conversation

elmerbulthuis
Copy link
Contributor

@elmerbulthuis elmerbulthuis commented May 27, 2020

This type infers the element type of an Iterable or an AsyncIterable. Very useful! Especially for generators. Also, an array and many other things are iterators!

@elmerbulthuis elmerbulthuis changed the title initial iterable element helpers Add IterableElement type May 27, 2020
@elmerbulthuis elmerbulthuis marked this pull request as ready for review May 27, 2020 12:19
@sindresorhus
Copy link
Owner

Sounds like a useful type.

Please make sure you adhere to https://github.com/sindresorhus/type-fest/blob/master/.github/contributing.md

The indentation should be tab, not spaces, and see other types for the comment format to use.

@sindresorhus
Copy link
Owner

The filename should also be iterable-element

@elmerbulthuis
Copy link
Contributor Author

hope it's better now!

@sindresorhus sindresorhus changed the title Add IterableElement type Add IterableElement type Jun 27, 2020
@sindresorhus
Copy link
Owner

You need to add it to the readme.

@sindresorhus
Copy link
Owner

If there has been any discussion somewhere about this type, include a link to it. For example, a discussion on the TypeScript issue tracker. - https://github.com/sindresorhus/type-fest/blob/master/.github/contributing.md

source/iterable-element.d.ts Outdated Show resolved Hide resolved
source/iterable-element.d.ts Outdated Show resolved Hide resolved
source/iterable-element.d.ts Outdated Show resolved Hide resolved
source/iterable-element.d.ts Outdated Show resolved Hide resolved
source/iterable-element.d.ts Show resolved Hide resolved
source/iterable-element.d.ts Outdated Show resolved Hide resolved
@elmerbulthuis
Copy link
Contributor Author

If there has been any discussion somewhere about this type, include a link to it. For example, a discussion on the TypeScript issue tracker. - https://github.com/sindresorhus/type-fest/blob/master/.github/contributing.md

No discussion AFAIK, I was looking for a type like IterableElement and came across type-fest. There was nothing like that in there so I decided to roll my own.

@sindresorhus
Copy link
Owner

#110 (comment) <<<

@sindresorhus
Copy link
Owner

Bump

@elmerbulthuis
Copy link
Contributor Author

Bump

ah sorry man! I've been very busy lately!

Added the type to the readme!

✌️

@elmerbulthuis
Copy link
Contributor Author

@sindresorhus bump :-)

@sindresorhus sindresorhus merged commit 0e8f4e3 into sindresorhus:master Sep 29, 2020
@sindresorhus
Copy link
Owner

Thanks :)

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

2 participants