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

Please, clarify description of Stream.any() #29540

Open
alsemenov opened this issue May 3, 2017 · 0 comments
Open

Please, clarify description of Stream.any() #29540

alsemenov opened this issue May 3, 2017 · 0 comments
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. core-a type-documentation A request to add or improve documentation

Comments

@alsemenov
Copy link
Contributor

The description of method dart:async:Stream.any() reads:

Future any(
bool test(
T element
)
)
Checks whether test accepts any element provided by this stream.

Completes the Future when the answer is known.

If this stream reports an error, the Future reports that error.

Stops listening to the stream after the first matching element has been found.

Internally the method cancels its subscription after this element. This means that single-subscription (non-broadcast) streams are closed and cannot be reused after a call to this method.

Please, clarify:

  1. The value used to complete the returned Future instance. (Is it true if element is found and false otherwise?)
  2. If test throws error (Is the error used to complete the returned future with error?
  3. If stream is done and no value was found. (Is the returned future completed with false?)
@kasperl kasperl added the area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. label May 3, 2017
@lrhn lrhn added the type-documentation A request to add or improve documentation label Sep 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. core-a type-documentation A request to add or improve documentation
Projects
None yet
Development

No branches or pull requests

4 participants