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

Get alternative with nullable return #22

Merged
merged 1 commit into from
Dec 28, 2023
Merged

Conversation

Conhan93
Copy link
Contributor

@Conhan93 Conhan93 commented Dec 2, 2023

A solution for #21.

A get style function that takes a compute function parameter with a nullable return
type and a nullable return in case the compute function fails to compute a new value.
@Conhan93 Conhan93 requested a review from sksamuel as a code owner December 2, 2023 23:49
@sksamuel
Copy link
Owner

Thanks for the PR. I think a more kotlin-ly name might be getOrNull since that's the idiom used in the SDK for things like toIntOrNull, so I will merge this and apply a rename before releasing 1.3.1

@sksamuel sksamuel merged commit b61049f into sksamuel:main Dec 28, 2023
1 check passed
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.

2 participants