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

Made GroupedSequence#each work for async parent sequences #72

Merged
merged 3 commits into from
Feb 26, 2014

Conversation

FrozenCow
Copy link
Contributor

GroupedSequence#each was not returning a AsyncHandle when the parent is an async sequence. This patch fixes the issue.

Along with that I've added a simple helper function that could be used in other places to transform (map?) a result. I thought this would be handy in places like https://github.com/dtao/lazy.js/blob/master/lazy.js#L2103.

@dtao
Copy link
Owner

dtao commented Feb 24, 2014

Haha, it's like you're reading my mind. Literally this morning on the bus ride to work I was patching up some similar issues and had the resolution: I really need to write some sort of generic solution to this problem (of returning either a value or an async handle).

It's a busy day at work, but I'll try to merge your two PRs and push my latest changes this afternoon.

@FrozenCow
Copy link
Contributor Author

Haha awesome. Take your time, no hurry ;).

It might also be a good idea to use some kind of standard for the AsyncHandle. I haven't used promises much, so I wouldn't know if there's a widely used library for this, but I can imagine there is. (I would imagine functions like transform already being implemented there)

@dtao
Copy link
Owner

dtao commented Feb 24, 2014

We are on the same page, my friend. #71

@FrozenCow
Copy link
Contributor Author

I didn't even realize. That's funny :D I'll comment there to keep things on-topic.

@dtao dtao merged commit c82cd24 into dtao:master Feb 26, 2014
@FrozenCow FrozenCow deleted the async_groupedsequence_each branch February 27, 2014 11:45
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.

2 participants