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

Add peekError and peekSuccess methods #3

Merged
merged 2 commits into from
Nov 21, 2024

Conversation

marcindabrowski
Copy link
Contributor

@marcindabrowski marcindabrowski commented Nov 21, 2024

Thanks for the library! It is helpful but I found that it lacks two methods that can improve the fluency of its usage.

peekError and peekSuccess methods can be used to consume success or error values and proceed with the same result.

Currently, to do the same logic as peekSuccess I have to use flatMap method that returns Result with success value that will be discarded.

I also corrected some spell check issues found by IntelliJ.

I didn't found how information about how to contribute, so I just run tests and checkstyle.
I would be great if you could add something, and add maven goal for automatic formatting.

Those methods can be used to consume success or error values and proceed with the same result.

Currently, to do the same logic as onSuccess I have to use flatMap method that returns Result with success value that will be discarded.
@marcindabrowski marcindabrowski force-pushed the feat/add-consumer-methods branch from 9811533 to 32afb11 Compare November 21, 2024 14:08
@sviperll
Copy link
Owner

Thank you very much for the contribution!

I've added a comment about the naming. I think on{Error,Success} may look too implicit, I propose to name those peek{Error,Success}.

I also corrected some spell check issues found by IntelliJ.

Thanks!

I didn't found how information about how to contribute, so I just run tests and checkstyle.
I would be great if you could add something, and add maven goal for automatic formatting.

I think what you've done is the intended process. Can you maybe share what you'd like to see? Something like CONTRIBUTING-file? Do you have an example that you think is good to take as an example to follow?

@marcindabrowski marcindabrowski changed the title Add onError and onSuccess methods Add peekError and peekSuccess methods Nov 21, 2024
@marcindabrowski
Copy link
Contributor Author

marcindabrowski commented Nov 21, 2024

Updated the PR.

I think you can add pull request template for your repository.

I would be nice if you also add information about Java used for building - I checked the manifest file from distribution jar and found that it was build with 21.

And I would be great to have some GitHub actions that runs all checks - I can help with that, just tell me what checks from maven has to be run.

@marcindabrowski
Copy link
Contributor Author

And may I ask why you are not following Semantic Versioning?

@sviperll
Copy link
Owner

I think you can add pull request template for your repository.

Ok, I'll try to do it.

I would be nice if you also add information about Java used for building - I checked the manifest file from distribution jar and found that it was build with 21.

I may add this to the README and to the maven-description to be more discoverable.

And I would be great to have some GitHub actions that runs all checks - I can help with that, just tell me what checks from maven has to be run.

I think we should run mvn verify. I would appreciate if you add a github-action.

And may I ask why you are not following Semantic Versioning?

What do you mean by this? There is only one version, how can I not follow semantic versioning?

I think the answer to most of your questions is that I do not have much time for maintenance and such a small library, like this one shouldn't require a lot of maintenance. I would gladly accept any contributions though.

@sviperll sviperll merged commit 4c428cf into sviperll:main Nov 21, 2024
@marcindabrowski
Copy link
Contributor Author

marcindabrowski commented Nov 21, 2024

Thanks for merging.

And may I ask why you are not following Semantic Versioning?

What do you mean by this? There is only one version, how can I not follow semantic versioning?

Semantic versioning assumes that library version is build using at least this: MAJOR.MINOR.PATCH.
And you released 1.0 not 1.0.0. And this is why I asked.

When you will release next version? Can you do it today/tomorrow? I would appreciate it.

GitHub action I will add at the evening or tomorrow.

@marcindabrowski marcindabrowski deleted the feat/add-consumer-methods branch November 21, 2024 16:30
@sviperll
Copy link
Owner

When you will release next version? Can you do it today/tomorrow? I would appreciate it.

Will do. Probably tomorrow morning.

@sviperll
Copy link
Owner

I've release your changes. You can use the new 1.1.3 version.

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