Skip to content

Documentation of some Stream members should be updated #56886

@sgrekhov

Description

@sgrekhov

See Stream.isEmpty:

sdk/sdk/lib/async/stream.dart

Lines 1317 to 1319 in c5c7fc8

/// This operation listens to this stream, and a non-broadcast stream cannot
/// be reused after checking whether it is empty.
Future<bool> get isEmpty {

Non-broadcast stream created by Stream.fromIterable() can be listened more than once, so it can be listened after call of isEmpty.

See Stream.elementAt():

sdk/sdk/lib/async/stream.dart

Lines 1565 to 1567 in c5c7fc8

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

The same. It's not true for non-broadcast streams created by Stream.fromIterable()

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-core-librarySDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.library-coretype-documentationA request to add or improve documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions