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

filter method #6

Open
rpominov opened this issue Jul 28, 2016 · 0 comments
Open

filter method #6

rpominov opened this issue Jul 28, 2016 · 0 comments

Comments

@rpominov
Copy link
Owner

The idea is that task.filter(predicate) will complete only when original tasks completes and the result satisfies the predicate. If the original task completes but result don't satisfies the predicate the result task will never complete.

Here is an example use case:

Task.race([
  possibleResult1.filter(isGoodResult),
  possibleResult2.filter(isGoodResult),
  possibleResult3.filter(isGoodResult),
  rejectsAfterSomeTime, // timeout
]).run(handleGoodResult, handleTimeout)
@rpominov rpominov added idea and removed raw idea labels Oct 3, 2016
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

No branches or pull requests

1 participant