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

feat: add last() to async sequence #36

Merged
merged 1 commit into from
Jul 15, 2022
Merged

feat: add last() to async sequence #36

merged 1 commit into from
Jul 15, 2022

Conversation

reddavis
Copy link
Owner

let sequence = AsyncStream<Int> { continuation in
    continuation.yield(1)
    continuation.yield(2)
    continuation.yield(3)
    continuation.finish()
}

print(await sequence.last())

// Prints:
// 3

@reddavis reddavis merged commit 35024e9 into main Jul 15, 2022
@reddavis reddavis deleted the feature/last branch July 15, 2022 05:01
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.

1 participant