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

When available, wrappers should be iterable #577

Closed
ljharb opened this issue Sep 1, 2016 · 4 comments
Closed

When available, wrappers should be iterable #577

ljharb opened this issue Sep 1, 2016 · 4 comments

Comments

@ljharb
Copy link
Member

ljharb commented Sep 1, 2016

When typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' is true, perhaps ShallowWrapper and ReactWrapper instances should be iterable, so they can be destructured?

@aweary
Copy link
Collaborator

aweary commented Sep 2, 2016

I haven't used iterators a lot, what's the use case here for making our wrappers iterable? What does destructed mean in the context of iterables?

@ljharb
Copy link
Member Author

ljharb commented Sep 2, 2016

const [linkOne, linkTwo] = wrapper.find('a')

@ljharb
Copy link
Member Author

ljharb commented Sep 2, 2016

basically, providing a shortcut so that you can destructure via .get()

@aweary
Copy link
Collaborator

aweary commented Sep 2, 2016

I like it 👍 I'd like to give this a try to get some exposure to iterables

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

No branches or pull requests

2 participants