Skip to content

for await-latest ? #328

Open
Open
@ursusursus

Description

@ursusursus

Hi, we need to be able to iterate over async sequence such that if the iteration does some async stuff & upstream happens to emit in the middle of it, the current iteration is cancelled & next one is subscribed (i.e. it doesn't wait)

for item in items.latest {
   try await sleep(long time)
}

this would mirror kotlin's collectLatest (also there's flatMapLatest, transformLatest which are very powerful & necessary

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions