Skip to content

Simplify Handler Registration API with Adapt, Func, and Must Functions#8

Merged
screwyprof merged 2 commits intomainfrom
feat/cleaner-api
Mar 30, 2023
Merged

Simplify Handler Registration API with Adapt, Func, and Must Functions#8
screwyprof merged 2 commits intomainfrom
feat/cleaner-api

Conversation

@screwyprof
Copy link
Copy Markdown
Owner

@screwyprof screwyprof commented Mar 30, 2023

Description

In this PR, we have refactored the handler registration API to make it more user-friendly and straightforward. We've introduced Adapt, Func, and Must helper functions to simplify the process and improve overall usability. By simplifying the handler registration API, developers will find it easier to work with the library, resulting in a more enjoyable and efficient development experience.

Type of change

Please delete options that are not relevant.

  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Additional Context (optional)

  • Introduced Adapt function to convert between different runner types
  • Added Func function to make it easier to create runners from simple functions
  • Implemented Must helper function to streamline error handling during registration

Checklist:

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings (make lint)
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes (make test)

@screwyprof screwyprof merged commit f8b5779 into main Mar 30, 2023
@screwyprof screwyprof deleted the feat/cleaner-api branch March 30, 2023 21:33
screwyprof added a commit that referenced this pull request Mar 30, 2023
…#8

​## Description

In this PR, we have refactored the handler registration API to make it more user-friendly and straightforward. We've introduced `Adapt`, `Func`, and `Must` helper functions to simplify the process and improve overall usability. By simplifying the handler registration API, developers will find it easier to work with the library, resulting in a more enjoyable and efficient development experience.

​## Type of change

Please delete options that are not relevant.
- [x] Breaking change (fix or feature that would cause existing functionality to not work as expected)

​## Additional Context (optional)

- Introduced `Adapt` function to convert between different runner types
- Added `Func` function to make it easier to create runners from simple functions
- Implemented `Must` helper function to streamline error handling during registration

​## Checklist:

- [x] I have performed a self-review of my own code
- [x] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings (`make lint`)
- [x] I have added tests that prove my fix is effective or that my feature works
- [x] New and existing unit tests pass locally with my changes (`make test`)
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