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 [Symbol.iterator] to CachedAsyncIterable #1

Merged
merged 2 commits into from
Jun 8, 2018

Conversation

stasm
Copy link
Contributor

@stasm stasm commented Jun 1, 2018

The [Symbol.iterator] method returns a synchronous iterator over the elements cached by the CachedAsyncIterable instance. This is useful in fluent-react where we can't really use the async iterable directly as it would create too many Promises, one for each <Localized> component. Instead, <Localized> can continue to use mapContextSync to synchronously iterate over the already fetched contexts. When fallback might be required, it can call touchNext to request the next context to be fetched.

stasm added 2 commits June 1, 2018 11:08
The [Symbol.iterator] method returns a synchronous iterator over the elements
cached by the CachedAsyncIterable instance.
@stasm
Copy link
Contributor Author

stasm commented Jun 7, 2018

@zbraniecki Would you like to review this?

Copy link
Collaborator

@zbraniecki zbraniecki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

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